gameServer/HWProtoInRoomState.hs
changeset 4986 33fe91b2bcbf
parent 4975 31da8979e5b1
child 4989 4771fed9272e
--- a/gameServer/HWProtoInRoomState.hs	Sat Mar 05 13:07:02 2011 +0100
+++ b/gameServer/HWProtoInRoomState.hs	Sat Mar 05 22:16:29 2011 +0300
@@ -64,7 +64,7 @@
                 [Warning "restricted"]
             else
                 [ModifyRoom (\r -> r{teams = teams r ++ [newTeam ci clNick r]}),
-                ModifyClient (\c -> c{teamsInGame = teamsInGame c + 1, clientClan = color}),
+                ModifyClient (\c -> c{teamsInGame = teamsInGame c + 1, clientClan = Just color}),
                 AnswerClients clChan ["TEAM_ACCEPTED", tName],
                 AnswerClients othChans $ teamToNet $ newTeam ci clNick rm,
                 AnswerClients othChans ["TEAM_COLOR", tName, color]
@@ -99,7 +99,7 @@
                 ModifyClient
                     (\c -> c{
                         teamsInGame = teamsInGame c - 1,
-                        clientClan = if teamsInGame c == 1 then undefined else anotherTeamClan ci r
+                            clientClan = if teamsInGame c == 1 then Nothing else Just $ anotherTeamClan ci r
                         })
                 ]
     where
@@ -148,7 +148,7 @@
         else
             [ModifyRoom $ modifyTeam team{teamcolor = newColor},
             AnswerClients others ["TEAM_COLOR", teamName, newColor],
-            ModifyClient2 (teamownerId team) (\c -> c{clientClan = newColor})]
+            ModifyClient2 (teamownerId team) (\c -> c{clientClan = Just newColor})]
     where
         findTeam = find (\t -> teamName == teamname t) . teams