219 -- client <- client's id |
219 -- client <- client's id |
220 clNick <- client's nick |
220 clNick <- client's nick |
221 chans <- othersChans |
221 chans <- othersChans |
222 |
222 |
223 if master then |
223 if master then |
224 if gameProgress && playersNum > 1 then |
224 if playersNum > 1 then |
225 mapM_ processAction [ChangeMaster, NoticeMessage AdminLeft, RemoveClientTeams ci, AnswerClients chans ["LEFT", clNick, msg]] |
225 mapM_ processAction [ChangeMaster, NoticeMessage AdminLeft, RemoveClientTeams ci, AnswerClients chans ["LEFT", clNick, msg]] |
226 else |
226 else |
227 processAction RemoveRoom |
227 processAction RemoveRoom |
228 else |
228 else |
229 mapM_ processAction [RemoveClientTeams ci, AnswerClients chans ["LEFT", clNick, msg]] |
229 mapM_ processAction [RemoveClientTeams ci, AnswerClients chans ["LEFT", clNick, msg]] |
230 |
230 |
231 -- when not removing room |
231 -- when not removing room |
232 ready <- client's isReady |
232 ready <- client's isReady |
233 when (not master || (gameProgress && playersNum > 1)) . io $ do |
233 when (not master || playersNum > 1) . io $ do |
234 modifyRoom rnc (\r -> r{ |
234 modifyRoom rnc (\r -> r{ |
235 playersIn = playersIn r - 1, |
235 playersIn = playersIn r - 1, |
236 readyPlayers = if ready then readyPlayers r - 1 else readyPlayers r |
236 readyPlayers = if ready then readyPlayers r - 1 else readyPlayers r |
237 }) ri |
237 }) ri |
238 moveClientToLobby rnc ci |
238 moveClientToLobby rnc ci |