Possibly unit limit bug?
Posted: 21 Jul 2007, 17:37
Yesterday I hosted a 5v5 game on green fields with a unit limit of around 2600.
At some point I had to take and got a spare tech 1 air field so I decided to build 100 scouts for an amusing scouring mission to end all scouting mission.
Anyway at some point after around 80 were made I could no longer build anything at all. I did CTRL+A to select all units and I only had 450. I also double checked script .txt and the max unit limit (MaxUnits) was indeed set to 2600 or so. To confirm it was definitely the unit limit I sent my 80 scout planes in to get shot to pieces and after that I could build again.
So basically there's a horrible unit limit bug.
I'm not entirely sure but I think this is the code responsible:
if(gameSetup)
maxUnits=gameSetup->maxUnits;
if(maxUnits>MAX_UNITS/gs->activeTeams-5)
maxUnits=MAX_UNITS/gs->activeTeams-5;
There were a couple of specs I think. And 5000/11 then -5 is 450 although I'm not entirely sure what activeTeams consists of. Basically what I would have thought this code should look like is this:
if(maxUnits>MAX_UNITS)
maxUnits=MAX_UNITS;
Because otherwise the maxunits value is being applied not per team but for all the teams combined.
That code is from UnitHandler.cpp so if it is indeed wrong a fix would be great, because otherwise 8v8 games are limited to 300 or less units per player regardless of what the unit limit was set to.
At some point I had to take and got a spare tech 1 air field so I decided to build 100 scouts for an amusing scouring mission to end all scouting mission.
Anyway at some point after around 80 were made I could no longer build anything at all. I did CTRL+A to select all units and I only had 450. I also double checked script .txt and the max unit limit (MaxUnits) was indeed set to 2600 or so. To confirm it was definitely the unit limit I sent my 80 scout planes in to get shot to pieces and after that I could build again.
So basically there's a horrible unit limit bug.
I'm not entirely sure but I think this is the code responsible:
if(gameSetup)
maxUnits=gameSetup->maxUnits;
if(maxUnits>MAX_UNITS/gs->activeTeams-5)
maxUnits=MAX_UNITS/gs->activeTeams-5;
There were a couple of specs I think. And 5000/11 then -5 is 450 although I'm not entirely sure what activeTeams consists of. Basically what I would have thought this code should look like is this:
if(maxUnits>MAX_UNITS)
maxUnits=MAX_UNITS;
Because otherwise the maxunits value is being applied not per team but for all the teams combined.
That code is from UnitHandler.cpp so if it is indeed wrong a fix would be great, because otherwise 8v8 games are limited to 300 or less units per player regardless of what the unit limit was set to.