# HG changeset patch # User unc0rr # Date 1390419761 -14400 # Node ID cb9e07753802242dc1d60bf12e45237e31f8e321 # Parent f738693be9be94273e7abe425a2eaa3f7443c486 Don't delegate special room to another player when owner quits diff -r f738693be9be -r cb9e07753802 gameServer/Actions.hs --- a/gameServer/Actions.hs Wed Jan 22 23:06:50 2014 +0400 +++ b/gameServer/Actions.hs Wed Jan 22 23:42:41 2014 +0400 @@ -221,7 +221,10 @@ ri <- clientRoomA rnc <- gets roomsClients specialRoom <- io $ room'sM rnc isSpecial ri - newMasterId <- liftM (\ids -> fromMaybe (listToMaybe . reverse . filter (/= ci) $ ids) $ liftM Just delegateId) . io $ roomClientsIndicesM rnc ri + newMasterId <- if specialRoom then + return Nothing + else + liftM (\ids -> fromMaybe (listToMaybe . reverse . filter (/= ci) $ ids) $ liftM Just delegateId) . io $ roomClientsIndicesM rnc ri newMaster <- io $ client'sM rnc id `DT.mapM` newMasterId oldMasterId <- io $ room'sM rnc masterID ri oldRoomName <- io $ room'sM rnc name ri diff -r f738693be9be -r cb9e07753802 gameServer/CMakeLists.txt --- a/gameServer/CMakeLists.txt Wed Jan 22 23:06:50 2014 +0400 +++ b/gameServer/CMakeLists.txt Wed Jan 22 23:42:41 2014 +0400 @@ -24,6 +24,7 @@ ServerState.hs Store.hs Utils.hs + Votes.hs hedgewars-server.hs )