Don't delegate special room to another player when owner quits
authorunc0rr
Wed, 22 Jan 2014 23:42:41 +0400
changeset 10056 cb9e07753802
parent 10055 f738693be9be
child 10057 795f5f918c8c
Don't delegate special room to another player when owner quits
gameServer/Actions.hs
gameServer/CMakeLists.txt
--- 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
--- 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
     )