From 44b8e87f43e752fc4f036a495fbae3889afd0fb3 Mon Sep 17 00:00:00 2001 From: bb Date: Thu, 24 Sep 2020 17:07:45 +0000 Subject: [PATCH] Don't use GetPopulationCount() in Player.js, but use the value it returns directly refs: 74f08a5083 Proposed By: Freagarach This was SVN commit r24067. --- binaries/data/mods/public/simulation/components/Player.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/binaries/data/mods/public/simulation/components/Player.js b/binaries/data/mods/public/simulation/components/Player.js index c5f88bc7d9..2cda187a9b 100644 --- a/binaries/data/mods/public/simulation/components/Player.js +++ b/binaries/data/mods/public/simulation/components/Player.js @@ -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;