tidy health transfer

This commit is contained in:
Chris Forbes
2012-07-01 18:08:10 +12:00
parent f5ba36a735
commit 5a40c5df03

View File

@@ -52,11 +52,11 @@ namespace OpenRA.Mods.RA.Activities
var health = self.TraitOrDefault<Health>();
if (health != null)
{
// TODO: Fix bogus health init
if (ForceHealthPercentage > 0)
init.Add( new HealthInit( ForceHealthPercentage * 1f / 100 ));
else
init.Add( new HealthInit( (float)health.HP / health.MaxHP ));
var newHP = (ForceHealthPercentage > 0)
? ForceHealthPercentage / 100f
: (float)health.HP / health.MaxHP;
init.Add( new HealthInit(newHP) );
}
var cargo = self.TraitOrDefault<Cargo>();