mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-07-04 05:55:47 -07:00
Added Player/MaxPopulation for technologies.
This was SVN commit r12739.
This commit is contained in:
parent
cc34cf169c
commit
7d0e660fbb
2 changed files with 9 additions and 3 deletions
|
|
@ -24,7 +24,9 @@ function GetTechModifiedProperty(currentTechModifications, entityTemplateData, p
|
|||
|
||||
// TODO: will we ever need the full template?
|
||||
// Get the classes which this entity template belongs to
|
||||
var rawClasses = entityTemplateData.Identity.Classes;
|
||||
var rawClasses;
|
||||
if (entityTemplateData && entityTemplateData.Identity)
|
||||
rawClasses = entityTemplateData.Identity.Classes;
|
||||
var classes = (rawClasses && "_string" in rawClasses ? rawClasses._string.split(/\s+/) : []);
|
||||
|
||||
var retValue = propertyValue;
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ Player.prototype.GetPopulationCount = function()
|
|||
|
||||
Player.prototype.GetPopulationLimit = function()
|
||||
{
|
||||
return Math.min(this.maxPop, this.popBonuses);
|
||||
return Math.min(this.GetMaxPopulation(), this.popBonuses);
|
||||
};
|
||||
|
||||
Player.prototype.SetMaxPopulation = function(max)
|
||||
|
|
@ -104,7 +104,11 @@ Player.prototype.SetMaxPopulation = function(max)
|
|||
|
||||
Player.prototype.GetMaxPopulation = function()
|
||||
{
|
||||
return this.maxPop;
|
||||
var cmpTechMan = Engine.QueryInterface(this.entity, IID_TechnologyManager);
|
||||
if (cmpTechMan)
|
||||
return cmpTechMan.ApplyModifications("Player/MaxPopulation", this.maxPop, this.entity);
|
||||
else
|
||||
return this.maxPop;
|
||||
};
|
||||
|
||||
Player.prototype.IsTrainingBlocked = function()
|
||||
|
|
|
|||
Loading…
Reference in a new issue