# HG changeset patch # User unc0rr # Date 1390421247 -14400 # Node ID 795f5f918c8c26deefc20f500ba096b1fe6e9b2e # Parent cb9e07753802242dc1d60bf12e45237e31f8e321 - Allow delegation to specific person in fixed room - Remove redundant check in DELEGATE handler diff -r cb9e07753802 -r 795f5f918c8c gameServer/Actions.hs --- a/gameServer/Actions.hs Wed Jan 22 23:42:41 2014 +0400 +++ b/gameServer/Actions.hs Thu Jan 23 00:07:27 2014 +0400 @@ -222,7 +222,7 @@ rnc <- gets roomsClients specialRoom <- io $ room'sM rnc isSpecial ri newMasterId <- if specialRoom then - return Nothing + delegateId 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 diff -r cb9e07753802 -r 795f5f918c8c gameServer/HWProtoInRoomState.hs --- a/gameServer/HWProtoInRoomState.hs Wed Jan 22 23:42:41 2014 +0400 +++ b/gameServer/HWProtoInRoomState.hs Thu Jan 23 00:07:27 2014 +0400 @@ -352,7 +352,6 @@ [ChangeMaster (Just newAdminId) | (master || serverAdmin) && isJust maybeClientId - && ((newAdminId /= thisClientId) || (serverAdmin && not master)) && (Just newAdminId /= thisRoomMasterId) && sameRoom]