Fix my previous commit where if you had enough units buildings would never construct (rounding issue).
This was SVN commit r13268.
This commit is contained in:
parent
791a901df9
commit
3f6702075b
@ -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 * this.buildMultiplier))));
|
||||
var deltaHP = Math.max(work, Math.min(maxHealth, Math.floor(maxHealth * (amount * this.buildMultiplier))));
|
||||
if (deltaHP > 0)
|
||||
{
|
||||
cmpHealth.Increase(deltaHP);
|
||||
|
Loading…
Reference in New Issue
Block a user