gameServer/Actions.hs
changeset 7926 550083f61a0e
parent 7924 351f970c60e1
child 7945 4006d77e1a28
--- a/gameServer/Actions.hs	Fri Nov 02 10:07:30 2012 +0400
+++ b/gameServer/Actions.hs	Fri Nov 02 10:17:52 2012 +0400
@@ -255,7 +255,7 @@
     proto <- client's clientProto
     ri <- clientRoomA
     rnc <- gets roomsClients
-    newMasterId <- liftM (head . filter (/= ci)) . io $ roomClientsIndicesM rnc ri
+    newMasterId <- liftM (last . filter (/= ci)) . io $ roomClientsIndicesM rnc ri
     newMaster <- io $ client'sM rnc id newMasterId
     oldRoomName <- io $ room'sM rnc name ri
     oldMaster <- client's nick
@@ -326,8 +326,8 @@
     rnc <- gets roomsClients
     ri <- io $ clientRoomM rnc clId
     rm <- io $ room'sM rnc id ri
+    n <- io $ client'sM rnc nick (masterID rm)
     chans <- liftM (map sendChan) $! sameProtoClientsS proto
-    n <- client's nick
     processAction $ AnswerClients chans ("ROOM" : "UPD" : name rm : roomInfo n rm)