# HG changeset patch # User unc0rr # Date 1301833900 -14400 # Node ID 28e0a6d2d09af9e946864a1991d80e52f2b2a720 # Parent 288dcbda3b77feaf1114485d0013f42a9190accb Fix crash when old room admin becomes new room admin diff -r 288dcbda3b77 -r 28e0a6d2d09a gameServer/Actions.hs --- a/gameServer/Actions.hs Sun Apr 03 13:34:04 2011 +0400 +++ b/gameServer/Actions.hs Sun Apr 03 16:31:40 2011 +0400 @@ -219,9 +219,10 @@ moveClientToLobby rnc ci processAction ChangeMaster = do + (Just ci) <- gets clientIndex ri <- clientRoomA rnc <- gets roomsClients - newMasterId <- liftM head . io $ roomClientsIndicesM rnc ri + newMasterId <- liftM (head . filter (/= ci)) . io $ roomClientsIndicesM rnc ri newMaster <- io $ client'sM rnc id newMasterId let newRoomName = nick newMaster mapM_ processAction [ @@ -407,7 +408,7 @@ [ AnswerClients [sendChan cl] ["CONNECTED", "Hedgewars server http://www.hedgewars.org/", serverVersion] , CheckBanned - , AddIP2Bans (host cl) "Reconnected too fast" (addUTCTime 10 $ connectTime cl) +-- , AddIP2Bans (host cl) "Reconnected too fast" (addUTCTime 10 $ connectTime cl) ]