gameServer/HWProtoInRoomState.hs
changeset 6738 dd98869d74b4
parent 6721 7dbf8a0c1f5d
child 6753 e95b1f62d0de
--- a/gameServer/HWProtoInRoomState.hs	Fri Feb 24 23:49:31 2012 +0400
+++ b/gameServer/HWProtoInRoomState.hs	Sat Feb 25 22:18:08 2012 +0400
@@ -211,19 +211,24 @@
     rm <- thisRoom
     chans <- roomClientsChans
 
-    if isMaster cl && isCorrect && (isJust $ gameInfo rm) then
-        return $
-            SaveReplay
-            : ModifyRoom
-                (\r -> r{
-                    gameInfo = Nothing,
-                    readyPlayers = 0
-                    }
-                )
-            : UnreadyRoomClients
-            : answerRemovedTeams chans rm
+    if isJust $ gameInfo rm then
+        if isMaster cl && isCorrect then
+            return $
+                SaveReplay
+                : ModifyRoom
+                    (\r -> r{
+                        gameInfo = Nothing,
+                        readyPlayers = 0
+                        }
+                    )
+                : UnreadyRoomClients
+                : answerRemovedTeams chans rm
+            else if not isCorrect then
+                return [RemoveClientTeams clId]
+                else
+                return []
         else
-        return [RemoveClientTeams clId]
+        return []
     where
         answerRemovedTeams chans = map (\t -> AnswerClients chans ["REMOVE_TEAM", t]) . leftTeams . fromJust . gameInfo
         isCorrect = correctly == "1"