1
0
forked from 0ad/0ad

Don't use GetPopulationCount() in Player.js, but use the value it returns directly

refs: 74f08a5083
Proposed By: Freagarach
This was SVN commit r24067.
This commit is contained in:
bb 2020-09-24 17:07:45 +00:00
parent 446b71e71e
commit 44b8e87f43

View File

@ -168,8 +168,8 @@ Player.prototype.GetDisplayedColor = function()
// Try reserving num population slots. Returns 0 on success or number of missing slots otherwise.
Player.prototype.TryReservePopulationSlots = function(num)
{
if (num != 0 && num > (this.GetPopulationLimit() - this.GetPopulationCount()))
return num - (this.GetPopulationLimit() - this.GetPopulationCount());
if (num != 0 && num > (this.GetPopulationLimit() - this.popUsed))
return num - (this.GetPopulationLimit() - this.popUsed);
this.popUsed += num;
return 0;