gameServer/HWProtoInRoomState.hs
changeset 8433 3b318a130a62
parent 8431 74c2c95ab07b
child 8477 330b0b8846cf
equal deleted inserted replaced
8431:74c2c95ab07b 8433:3b318a130a62
   109             else
   109             else
   110                 [RemoveTeam tName,
   110                 [RemoveTeam tName,
   111                 ModifyClient
   111                 ModifyClient
   112                     (\c -> c{
   112                     (\c -> c{
   113                         teamsInGame = teamsInGame c - 1,
   113                         teamsInGame = teamsInGame c - 1,
   114                         clientClan = if teamsInGame c == 1 then Nothing else Just $ anotherTeamClan ci r
   114                         clientClan = if teamsInGame c == 1 then Nothing else Just $ anotherTeamClan ci team r
   115                     })
   115                     })
   116                 ]
   116                 ]
   117     where
   117     where
   118         anotherTeamClan ci = teamcolor . fromJust . find (\t -> (teamownerId t == ci) && (t /= team)) . teams
   118         anotherTeamClan ci team = teamcolor . fromMaybe (error "CHECKPOINT 011") . find (\t -> (teamownerId t == ci) && (t /= team)) . teams
   119         findTeam = find (\t -> tName == teamname t) . teams
   119         findTeam = find (\t -> tName == teamname t) . teams
   120 
   120 
   121 
   121 
   122 handleCmd_inRoom ["HH_NUM", teamName, numberStr] = do
   122 handleCmd_inRoom ["HH_NUM", teamName, numberStr] = do
   123     cl <- thisClient
   123     cl <- thisClient