1
0
forked from 0ad/0ad

Fix a bug with the foundation changes that caused buildings to be built too fast with multiple units.

This was SVN commit r13267.
This commit is contained in:
wraitii 2013-03-12 08:22:45 +00:00
parent 9b1b8cc8fd
commit 791a901df9

View File

@ -247,7 +247,7 @@ Foundation.prototype.Build = function(builderEnt, work)
// Add an appropriate proportion of hitpoints
var cmpHealth = Engine.QueryInterface(this.entity, IID_Health);
var maxHealth = cmpHealth.GetMaxHitpoints();
var deltaHP = Math.max(0, Math.min(maxHealth, Math.floor(maxHealth * amount)));
var deltaHP = Math.max(0, Math.min(maxHealth, Math.floor(maxHealth * (amount * this.buildMultiplier))));
if (deltaHP > 0)
{
cmpHealth.Increase(deltaHP);