forked from 0ad/0ad
still another fix to the gatherer count
This was SVN commit r14567.
This commit is contained in:
parent
82fa27bad4
commit
eee6ed65dc
@ -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
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user