Fix giving foundations a population bonus after a tech research. Reported by bouke

This was SVN commit r15391.
This commit is contained in:
sanderd17 2014-06-18 15:58:04 +00:00
parent a76364f825
commit c9f2ac4b12
2 changed files with 7 additions and 2 deletions

View File

@ -1515,8 +1515,8 @@ function performCommand(entity, commandName)
if (!entState.player == playerID && !g_DevSettings.controlAll)
return;
if (entityCommands[commandName])
entityCommands[commandName].execute(entState);
if (g_EntityCommands[commandName])
g_EntityCommands[commandName].execute(entState);
}
// Performs the specified formation

View File

@ -87,6 +87,11 @@ Cost.prototype.OnValueModification = function(msg)
if (msg.component != "Cost")
return;
// foundations shouldn't give a pop bonus
var cmpFoundation = Engine.QueryInterface(this.entity, IID_Foundation)
if (cmpFoundation)
return;
// update the population bonuses
var newPopBonus = ApplyValueModificationsToEntity("Cost/PopulationBonus", +this.template.PopulationBonus, this.entity);
var popDifference = newPopBonus - this.populationBonus;