gameServer/HWProtoInRoomState.hs
changeset 15878 fc3cb23fd26f
parent 14841 111c4d750c6d
--- a/gameServer/HWProtoInRoomState.hs	Fri Sep 23 12:47:47 2022 -0400
+++ b/gameServer/HWProtoInRoomState.hs	Tue Sep 27 14:59:03 2022 +0300
@@ -313,7 +313,8 @@
     cl <- thisClient
     rs <- allRoomInfos
     rm <- thisRoom
-    chans <- sameProtoChans
+    chansProto <- allChansProto
+    let thisRoomNameByProto = roomNameByProto (name rm) (roomProto rm)
 
     return $
         if illegalName newName then
@@ -326,7 +327,7 @@
             [Warning $ loc "A room with the same name already exists."]
         else
             [ModifyRoom roomUpdate,
-            AnswerClients chans ("ROOM" : "UPD" : name rm : roomInfo (clientProto cl) (nick cl) (roomUpdate rm)),
+            AnswerClientsByProto chansProto (\p -> "ROOM" : "UPD" : thisRoomNameByProto p : roomInfo p (nick cl) (roomUpdate rm)),
             RegisterEvent RoomNameUpdate]
     where
         roomUpdate r = r{name = newName}