Some fixes
authorunc0rr
Fri, 25 Jan 2013 13:29:20 +0400
changeset 8433 3b318a130a62
parent 8431 74c2c95ab07b
child 8457 071d118b3283
Some fixes
gameServer/CoreTypes.hs
gameServer/HWProtoInRoomState.hs
--- a/gameServer/CoreTypes.hs	Fri Jan 25 12:59:06 2013 +0400
+++ b/gameServer/CoreTypes.hs	Fri Jan 25 13:29:20 2013 +0400
@@ -38,7 +38,7 @@
         isAdministrator :: Bool,
         isChecker :: Bool,
         isKickedFromServer :: Bool,
-        clientClan :: !Maybe B.ByteString,
+        clientClan :: !(Maybe B.ByteString),
         teamsInGame :: Word
     }
 
--- a/gameServer/HWProtoInRoomState.hs	Fri Jan 25 12:59:06 2013 +0400
+++ b/gameServer/HWProtoInRoomState.hs	Fri Jan 25 13:29:20 2013 +0400
@@ -111,11 +111,11 @@
                 ModifyClient
                     (\c -> c{
                         teamsInGame = teamsInGame c - 1,
-                        clientClan = if teamsInGame c == 1 then Nothing else Just $ anotherTeamClan ci r
+                        clientClan = if teamsInGame c == 1 then Nothing else Just $ anotherTeamClan ci team r
                     })
                 ]
     where
-        anotherTeamClan ci = teamcolor . fromJust . find (\t -> (teamownerId t == ci) && (t /= team)) . teams
+        anotherTeamClan ci team = teamcolor . fromMaybe (error "CHECKPOINT 011") . find (\t -> (teamownerId t == ci) && (t /= team)) . teams
         findTeam = find (\t -> tName == teamname t) . teams