Fix off-by-1 error
authorunC0Rr
Wed, 01 Apr 2015 10:17:01 +0300
changeset 10884 7b76811fb689
parent 10883 294ef49efdd2
child 10885 3ea36d8d4636
Fix off-by-1 error
gameServer/HWProtoInRoomState.hs
--- a/gameServer/HWProtoInRoomState.hs	Wed Apr 01 02:42:37 2015 +0200
+++ b/gameServer/HWProtoInRoomState.hs	Wed Apr 01 10:17:01 2015 +0300
@@ -125,7 +125,7 @@
                     defaultHedgehogsNumber rm
         let newTeam = clNick `seq` TeamInfo clNick tName teamColor grave fort voicepack flag isRegistered dif hhNum (hhsList hhsInfo)
         return $
-            if not . null . drop (teamsNumberLimit rm) $ roomTeams then
+            if not . null . drop (teamsNumberLimit rm - 1) $ roomTeams then
                 [Warning $ loc "too many teams"]
             else if canAddNumber roomTeams <= 0 then
                 [Warning $ loc "too many hedgehogs"]