still another fix to the gatherer count

This was SVN commit r14567.
This commit is contained in:
mimo 2014-01-10 22:50:13 +00:00
parent 82fa27bad4
commit eee6ed65dc
2 changed files with 5 additions and 5 deletions

View File

@ -163,7 +163,7 @@ function displaySingle(entState, template)
Engine.GetGUIObjectByName("resourceCarryingIcon").hidden = false;
Engine.GetGUIObjectByName("resourceCarryingText").hidden = false;
Engine.GetGUIObjectByName("resourceCarryingIcon").sprite = "stretched:session/icons/repair.png";
Engine.GetGUIObjectByName("resourceCarryingText").caption = entState.resourceSupply.gatherers[entState.player].length + " / " + entState.resourceSupply.maxGatherers + " ";
Engine.GetGUIObjectByName("resourceCarryingText").caption = entState.resourceSupply.gatherers[entState.player-1].length + " / " + entState.resourceSupply.maxGatherers + " ";
Engine.GetGUIObjectByName("resourceCarryingIcon").tooltip = "Current/max gatherers";
}
else

View File

@ -44,13 +44,13 @@ ResourceSupply.prototype.Init = function()
// Current resource amount (non-negative)
this.amount = this.GetMaxAmount();
this.gatherers = []; // list of IDs for each players
this.gatherers = []; // list of IDs for each players
var cmpPlayerManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager); // system component so that's safe.
var numPlayers = cmpPlayerManager.GetNumPlayers();
for (var i = 0; i < numPlayers; ++i)
this.gatherers.push([]);
for (var i = 0; i < numPlayers; ++i)
this.gatherers.push([]);
this.infinite = !isFinite(+this.template.Amount);
this.infinite = !isFinite(+this.template.Amount);
};
ResourceSupply.prototype.IsInfinite = function()