From 25b522ea8d99427c9a78fd4e9ee75c7e00cf528e Mon Sep 17 00:00:00 2001 From: Jeena Paradies Date: Mon, 16 May 2011 18:18:58 +0200 Subject: [PATCH] fixed problem with crash if you click too early --- games/tic-tac-toe-python/server.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/games/tic-tac-toe-python/server.js b/games/tic-tac-toe-python/server.js index 32b609f..5c8d5dd 100644 --- a/games/tic-tac-toe-python/server.js +++ b/games/tic-tac-toe-python/server.js @@ -1,9 +1,12 @@ function playerCommand(player_id, command, args) { + var p1_id = GGS.localStorage.getItem("p1_id"); + var p2_id = GGS.localStorage.getItem("p2_id"); + if (command == "hi") { hi(player_id); - } else if (command == "set") { + } else if (command == "set" && p1_id && p2_id) { move(player_id, args); - } else if (command == "new") { + } else if (command == "new" && p1_id && p2_id) { newGame(); } }