- Check ready status only after deleting player's teams (should fix the bug when you're unable to start game)
authorunc0rr
Sat, 07 Jul 2012 23:31:59 +0400
changeset 7351 34efdd1f230f
parent 7348 2a69f2ed9273
child 7354 b79b545bd568
- Check ready status only after deleting player's teams (should fix the bug when you're unable to start game) - Send LEFT message after deletion of player's teams (no idea if this breaks anything, but this is more accurate behavior)
gameServer/Actions.hs
--- a/gameServer/Actions.hs	Sat Jul 07 15:28:47 2012 -0400
+++ b/gameServer/Actions.hs	Sat Jul 07 23:31:59 2012 +0400
@@ -210,7 +210,6 @@
     ri <- clientRoomA
     rnc <- gets roomsClients
     (gameProgress, playersNum) <- io $ room'sM rnc ((isJust . gameInfo) &&& playersIn) ri
-    ready <- client's isReady
     master <- client's isMaster
 --    client <- client's id
     clNick <- client's nick
@@ -218,13 +217,14 @@
 
     if master then
         if gameProgress && playersNum > 1 then
-            mapM_ processAction [ChangeMaster, AnswerClients chans ["LEFT", clNick, msg], NoticeMessage AdminLeft, RemoveClientTeams ci]
+            mapM_ processAction [ChangeMaster, NoticeMessage AdminLeft, RemoveClientTeams ci, AnswerClients chans ["LEFT", clNick, msg]]
             else
             processAction RemoveRoom
         else
-        mapM_ processAction [AnswerClients chans ["LEFT", clNick, msg], RemoveClientTeams ci]
+        mapM_ processAction [RemoveClientTeams ci, AnswerClients chans ["LEFT", clNick, msg]]
 
     -- when not removing room
+    ready <- client's isReady
     when (not master || (gameProgress && playersNum > 1)) . io $ do
         modifyRoom rnc (\r -> r{
                 playersIn = playersIn r - 1,