From 2640603f6c65743c0803b64d98bef3cbc8237cac Mon Sep 17 00:00:00 2001 From: geckosoft Date: Fri, 29 Oct 2010 00:22:59 +1300 Subject: [PATCH] Added 'Health' and 'PreviousHealth' to the AttackInfo (so we can know how many 'real' damage is done!) --- OpenRA.Game/Traits/Health.cs | 4 +++- OpenRA.Game/Traits/TraitsInterfaces.cs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenRA.Game/Traits/Health.cs b/OpenRA.Game/Traits/Health.cs index 1f5283af8a..9de4c74dda 100755 --- a/OpenRA.Game/Traits/Health.cs +++ b/OpenRA.Game/Traits/Health.cs @@ -96,7 +96,9 @@ namespace OpenRA.Traits DamageState = this.DamageState, PreviousDamageState = oldState, DamageStateChanged = this.DamageState != oldState, - Warhead = warhead + Warhead = warhead, + PreviousHealth = hp + damage < 0 ? 0 : hp + damage, + Health = hp }); if (hp <= 0) diff --git a/OpenRA.Game/Traits/TraitsInterfaces.cs b/OpenRA.Game/Traits/TraitsInterfaces.cs index e27bf4f877..a400bc47f4 100755 --- a/OpenRA.Game/Traits/TraitsInterfaces.cs +++ b/OpenRA.Game/Traits/TraitsInterfaces.cs @@ -29,7 +29,9 @@ namespace OpenRA.Traits public int Damage; public DamageState DamageState; public DamageState PreviousDamageState; - public bool DamageStateChanged; + public bool DamageStateChanged; + public int PreviousHealth; + public int Health; } public interface ITick { void Tick(Actor self); }