gameServer/Actions.hs
changeset 7367 ad3f5f2e6ea9
parent 7351 34efdd1f230f
child 7465 c2dcf97ca664
--- a/gameServer/Actions.hs	Sat Jul 07 19:59:44 2012 +0400
+++ b/gameServer/Actions.hs	Sun Jul 08 13:18:52 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,