gameServer/HWProtoInRoomState.hs
changeset 8897 d6c310c65c91
parent 8757 266df6d5ed73
child 8899 7493dde4ef51
--- a/gameServer/HWProtoInRoomState.hs	Wed Apr 10 07:44:51 2013 +0300
+++ b/gameServer/HWProtoInRoomState.hs	Wed Apr 10 22:48:14 2013 +0400
@@ -59,7 +59,7 @@
                 else
                 liftM (head . (L.\\) (map B.singleton ['0'..]) . map teamcolor . teams) thisRoom
         let roomTeams = teams rm
-        let hhNum = let p = if not $ null roomTeams then hhnum $ head roomTeams else 4 in newTeamHHNum roomTeams p
+        let hhNum = let p = if not $ null roomTeams then minimum [hhnum $ head roomTeams, canAddNumber roomTeams] else 4 in newTeamHHNum roomTeams p
         let newTeam = clNick `seq` TeamInfo ci clNick tName teamColor grave fort voicepack flag dif hhNum (hhsList hhsInfo)
         return $
             if not . null . drop (maxTeams rm - 1) $ roomTeams then
@@ -79,9 +79,7 @@
                 AnswerClients clChan ["TEAM_ACCEPTED", tName],
                 AnswerClients othChans $ teamToNet $ newTeam,
                 AnswerClients roomChans ["TEAM_COLOR", tName, teamColor],
-                ModifyClient $ \c -> c{actionsPending = actionsPending cl
-                    ++ [AnswerClients clChan ["HH_NUM", tName, showB $ hhnum newTeam]]
-                    },
+                AnswerClients roomChans ["HH_NUM", tName, showB $ hhnum newTeam],
                 AnswerClients [sendChan cl] ["PING"]
                 ]
         where