1
0
forked from 0ad/0ad

Remove a useless value cap in Foundation code. Reviewed by wraitii.

Differential Revision: https://code.wildfiregames.com/D550
This was SVN commit r19832.
This commit is contained in:
fatherbushido 2017-06-26 12:48:00 +00:00
parent 8ba425d89f
commit 26e6f901f1

View File

@ -1,7 +1,7 @@
function Foundation() {}
Foundation.prototype.Schema =
"<a:component type='internal'/><empty/>";
"<empty/>";
Foundation.prototype.Init = function()
{
@ -268,8 +268,7 @@ Foundation.prototype.Build = function(builderEnt, work)
error("Foundation " + this.entity + " does not have a health component.");
return;
}
var maxHealth = cmpHealth.GetMaxHitpoints();
var deltaHP = Math.max(work, Math.min(maxHealth, work * this.GetBuildRate() * this.buildMultiplier));
var deltaHP = work * this.GetBuildRate() * this.buildMultiplier;
if (deltaHP > 0)
cmpHealth.Increase(deltaHP);