1
0
forked from mirrors/0ad

Round max hp of units in simulation. Refs #3855

This was SVN commit r17951.
This commit is contained in:
sanderd17
2016-03-25 12:51:48 +00:00
parent e8decfbd2b
commit 6f0d0ff8f4
@@ -44,7 +44,7 @@ Health.prototype.Schema =
Health.prototype.Init = function()
{
// Cache this value so it allows techs to maintain previous health level
this.maxHitpoints = +this.template.Max;
this.maxHitpoints = Math.round(+this.template.Max);
// Default to <Initial>, but use <Max> if it's undefined or zero
// (Allowing 0 initial HP would break our death detection code)
this.hitpoints = +(this.template.Initial || this.GetMaxHitpoints());