- Fix a problem with ghost teams (missing 'not')
authorunc0rr
Fri, 11 Mar 2011 22:22:28 +0300
changeset 4999 a3a09b107652
parent 4998 cdcdf37e5532
child 5000 72d8fb26223d
- Fix a problem with ghost teams (missing 'not') - Fix formatting a little bit
gameServer/Actions.hs
--- a/gameServer/Actions.hs	Thu Mar 10 22:28:40 2011 +0300
+++ b/gameServer/Actions.hs	Fri Mar 11 22:22:28 2011 +0300
@@ -206,11 +206,11 @@
         mapM_ processAction [AnswerClients chans ["LEFT", clNick, msg], RemoveClientTeams ci]
 
     io $ do
-            modifyRoom rnc (\r -> r{
-                    playersIn = playersIn r - 1,
-                    readyPlayers = if ready then readyPlayers r - 1 else readyPlayers r
-                    }) ri
-            moveClientToLobby rnc ci
+        modifyRoom rnc (\r -> r{
+                playersIn = playersIn r - 1,
+                readyPlayers = if ready then readyPlayers r - 1 else readyPlayers r
+                }) ri
+        moveClientToLobby rnc ci
 
 processAction ChangeMaster = do
     ri <- clientRoomA
@@ -282,7 +282,7 @@
     ri <- clientRoomA
     inGame <- io $ room'sM rnc gameinprogress ri
     chans <- othersChans
-    if inGame then
+    if not $ inGame then
             mapM_ processAction [
                 AnswerClients chans ["REMOVE_TEAM", teamName],
                 ModifyRoom (\r -> r{teams = Prelude.filter (\t -> teamName /= teamname t) $ teams r})