Add support for non-integer GarrisonHolder regen rates; round health up in the GUI. Refs #1633.
This was SVN commit r12651.
This commit is contained in:
parent
502311fe5c
commit
7d8ef7a2ef
@ -14,7 +14,7 @@ GarrisonHolder.prototype.Schema =
|
||||
"<ref name='nonNegativeDecimal'/>" +
|
||||
"</element>" +
|
||||
"<element name='BuffHeal' a:help='Number of hit points that will be restored to this holder's garrisoned units each second'>" +
|
||||
"<data type='nonNegativeInteger'/>" +
|
||||
"<ref name='nonNegativeDecimal'/>" +
|
||||
"</element>" +
|
||||
"<element name='LoadingRange' a:help='The maximum distance from this holder at which entities are allowed to garrison. Should be about 2.0 for land entities and preferably greater for ships'>" +
|
||||
"<ref name='nonNegativeDecimal'/>" +
|
||||
|
@ -165,7 +165,7 @@ GuiInterface.prototype.GetEntityState = function(player, ent)
|
||||
var cmpHealth = Engine.QueryInterface(ent, IID_Health);
|
||||
if (cmpHealth)
|
||||
{
|
||||
ret.hitpoints = cmpHealth.GetHitpoints();
|
||||
ret.hitpoints = Math.ceil(cmpHealth.GetHitpoints());
|
||||
ret.maxHitpoints = cmpHealth.GetMaxHitpoints();
|
||||
ret.needsRepair = cmpHealth.IsRepairable() && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints());
|
||||
ret.needsHeal = !cmpHealth.IsUnhealable();
|
||||
|
Loading…
Reference in New Issue
Block a user