Skip to content
Snippets Groups Projects
Commit 7634a71b authored by atm2g19's avatar atm2g19
Browse files

minor bugfix:

undefined player id from socket
parent 8a4b4533
No related branches found
No related tags found
No related merge requests found
...@@ -335,6 +335,7 @@ const battleships : GameConstructor = class battleships implements Game{ ...@@ -335,6 +335,7 @@ const battleships : GameConstructor = class battleships implements Game{
leave(sock_id : string){ leave(sock_id : string){
let player = this.getPlayer(sock_id); let player = this.getPlayer(sock_id);
if(!player) return;
this.players = this.players.filter(p => p==player?0:1); this.players = this.players.filter(p => p==player?0:1);
let game_id = player.game_id; let game_id = player.game_id;
this.db.query(`SELECT data_key, data_value FROM game_data WHERE game_id = ${game_id} AND data_key = 0;`) this.db.query(`SELECT data_key, data_value FROM game_data WHERE game_id = ${game_id} AND data_key = 0;`)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment