gameServer/HWProtoInRoomState.hs
changeset 4941 90572c338e60
parent 4932 f11d80bac7ed
child 4942 1c85a8e6e11c
--- a/gameServer/HWProtoInRoomState.hs	Mon Feb 14 08:31:45 2011 -0500
+++ b/gameServer/HWProtoInRoomState.hs	Tue Feb 15 21:12:22 2011 +0300
@@ -33,10 +33,15 @@
         cl <- thisClient
         if isMaster cl then
            return [
-                ModifyRoom (\r -> r{params = Map.insert paramName paramStrs (params r)}),
+                ModifyRoom f,
                 AnswerClients chans ("CFG" : paramName : paramStrs)]
             else
             return [ProtocolError "Not room master"]
+    where
+        f r = if paramName `Map.member` (mapParams r) then
+                r{mapParams = Map.insert paramName (head paramStrs) (mapParams r)}
+                else
+                r{params = Map.insert paramName paramStrs (params r)}
 
 handleCmd_inRoom ("ADD_TEAM" : tName : color : grave : fort : voicepack : flag : difStr : hhsInfo)
     | length hhsInfo /= 16 = return [ProtocolError "Corrupted hedgehogs info"]