Convert the float health percentage to an int one

This commit is contained in:
abcdefg30
2015-02-14 22:19:17 +01:00
parent 732001f3f3
commit 8d2307db83
5 changed files with 20 additions and 19 deletions

View File

@@ -70,10 +70,7 @@ namespace OpenRA.Mods.Common.Activities
var health = self.TraitOrDefault<Health>();
if (health != null)
{
var newHP = (ForceHealthPercentage > 0)
? ForceHealthPercentage / 100f
: (float)health.HP / health.MaxHP;
var newHP = (ForceHealthPercentage > 0) ? ForceHealthPercentage : (health.HP * 100) / health.MaxHP;
init.Add(new HealthInit(newHP));
}