gameServer/HWProtoInRoomState.hs
changeset 11414 6f119783a1ad
parent 11046 47a8c19ecb60
child 11508 a4ad8a9e0f69
equal deleted inserted replaced
11412:c19f2387d24f 11414:6f119783a1ad
   173             else
   173             else
   174                 [RemoveTeam tName,
   174                 [RemoveTeam tName,
   175                 ModifyClient
   175                 ModifyClient
   176                     (\c -> c{
   176                     (\c -> c{
   177                         teamsInGame = teamsInGame c - 1,
   177                         teamsInGame = teamsInGame c - 1,
   178                         clientClan = if teamsInGame c == 1 then Nothing else Just $ anotherTeamClan clNick team r
   178                         clientClan = if teamsInGame c == 1 then Nothing else anotherTeamClan clNick team r
   179                     })
   179                     })
   180                 ]
   180                 ]
   181     where
   181     where
   182         anotherTeamClan clNick team = teamcolor . fromMaybe (error "CHECKPOINT 011") . find (\t -> (teamowner t == clNick) && (t /= team)) . teams
   182         anotherTeamClan clNick team = liftM teamcolor . find (\t -> (teamowner t == clNick) && (t /= team)) . teams
   183         findTeam = find (\t -> tName == teamname t) . teams
   183         findTeam = find (\t -> tName == teamname t) . teams
   184 
   184 
   185 
   185 
   186 handleCmd_inRoom ["HH_NUM", teamName, numberStr] = do
   186 handleCmd_inRoom ["HH_NUM", teamName, numberStr] = do
   187     cl <- thisClient
   187     cl <- thisClient