1
0
forked from 0ad/0ad

Fix PetraAI not building many houses.

Previous to 7f77cf2f3e the AI got its population bonus per entity from
the Cost component, which every entity happened to have.
Thereafter, the population bonus was handled by a separate component,
which was not always present leading to `(void 0)` additions to the pop
cap and PetraAI not constructing houses.

Differential revision: D3360
Reviewed by: @Angen, @wraitii
This was SVN commit r24613.
This commit is contained in:
Freagarach 2021-01-15 05:59:23 +00:00
parent 89060a3efa
commit 8421ba77fb

View File

@ -194,7 +194,12 @@ m.Template = m.Class({
"isRepairable": function() { return this.get("Repairable") !== undefined; },
"getPopulationBonus": function() { return +this.get("Population/Bonus"); },
"getPopulationBonus": function() {
if (!this.get("Population"))
return 0;
return +this.get("Population/Bonus");
},
"resistanceStrengths": function() {
let resistanceTypes = this.get("Resistance");