gameServer/HWProtoInRoomState.hs
changeset 8403 fbc6e7602e05
parent 8401 87410ae372f6
child 8416 e691acd778f5
--- a/gameServer/HWProtoInRoomState.hs	Sat Jan 19 00:55:51 2013 +0400
+++ b/gameServer/HWProtoInRoomState.hs	Sat Jan 19 21:51:41 2013 +0400
@@ -304,10 +304,15 @@
     (thisClientId, rnc) <- ask
     maybeClientId <- clientByNick newAdmin
     master <- liftM isMaster thisClient
+    serverAdmin <- liftM isAdministrator thisClient
     let newAdminId = fromJust maybeClientId
     let sameRoom = clientRoom rnc thisClientId == clientRoom rnc newAdminId
     return
-        [ChangeMaster (Just newAdminId) | master && isJust maybeClientId && (newAdminId /= thisClientId) && sameRoom]
+        [ChangeMaster (Just newAdminId) |
+            (master || serverAdmin)
+                && isJust maybeClientId
+                && ((newAdminId /= thisClientId) || (serverAdmin && not master))
+                && sameRoom]
 
 
 handleCmd_inRoom ["TEAMCHAT", msg] = do