fix Bridge init
This commit is contained in:
@@ -44,7 +44,11 @@ namespace OpenRA.Traits
|
||||
|
||||
public int HP { get { return hp; } }
|
||||
public readonly int MaxHP;
|
||||
public float HPFraction { get { return hp*1f/MaxHP; } }
|
||||
public float HPFraction
|
||||
{
|
||||
get { return hp * 1f / MaxHP; }
|
||||
set { hp = (int)(value * MaxHP); }
|
||||
}
|
||||
|
||||
public bool IsDead { get { return hp <= 0; } }
|
||||
public bool RemoveOnDeath = true;
|
||||
|
||||
@@ -90,9 +90,9 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
currentTemplate = template;
|
||||
if (template == Info.DamagedTemplate)
|
||||
Health.InflictDamage(self, self, Health.MaxHP/2, null);
|
||||
Health.HPFraction = .5f;
|
||||
else if (template != Info.Template)
|
||||
Health.InflictDamage(self, self, Health.MaxHP, null);
|
||||
Health.HPFraction = 0f;
|
||||
|
||||
// Create a new cache to store the tile data
|
||||
if (cachedTileset != self.World.Map.Tileset)
|
||||
|
||||
Reference in New Issue
Block a user