diff -r d2bca8e68688 -r cd85ab23f38b gameServer/HWProtoInRoomState.hs --- a/gameServer/HWProtoInRoomState.hs Mon Feb 18 00:22:16 2013 +0100 +++ b/gameServer/HWProtoInRoomState.hs Mon Feb 18 22:21:31 2013 +0400 @@ -181,6 +181,7 @@ ["CLIENT_FLAGS", if isReady cl then "-r" else "+r", nick cl] ] + handleCmd_inRoom ["START_GAME"] = do (ci, rnc) <- ask cl <- thisClient @@ -297,10 +298,19 @@ (thisClientId, rnc) <- ask maybeClientId <- clientByNick kickNick master <- liftM isMaster thisClient + rm <- thisRoom let kickId = fromJust maybeClientId + let kickCl = rnc `client` kickId let sameRoom = clientRoom rnc thisClientId == clientRoom rnc kickId + let notOnly2Clans = (length . group . sort . map teamcolor . teams $ rm) > 2 return - [KickRoomClient kickId | master && isJust maybeClientId && (kickId /= thisClientId) && sameRoom] + [KickRoomClient kickId | + master + && isJust maybeClientId + && (kickId /= thisClientId) + && sameRoom + && ((isNothing $ gameInfo rm) || notOnly2Clans || teamsInGame kickCl = 0) + ] handleCmd_inRoom ["DELEGATE", newAdmin] = do