From dd17a99ab5273d309d1ef6032a163479aeacab1a Mon Sep 17 00:00:00 2001 From: Taryn Hill Date: Wed, 30 Oct 2013 23:04:21 -0400 Subject: [PATCH] Checks to make sure Attacker is not null. Ignores self-attacking. Ignores friendly-fire that does <= 0 damage (repairs). --- OpenRA.Mods.RA/Player/BaseAttackNotifier.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.RA/Player/BaseAttackNotifier.cs b/OpenRA.Mods.RA/Player/BaseAttackNotifier.cs index 8ce7d9e876..53c2fd6aa8 100644 --- a/OpenRA.Mods.RA/Player/BaseAttackNotifier.cs +++ b/OpenRA.Mods.RA/Player/BaseAttackNotifier.cs @@ -37,8 +37,13 @@ namespace OpenRA.Mods.RA if (!self.HasTrait()) return; - // don't track self-damage - if (e.Attacker != null && e.Attacker.Owner == self.Owner) + if (e.Attacker == null) + return; + + if (e.Attacker.Owner == self.Owner) + return; + + if (e.Attacker.Owner.IsAlliedWith(self.Owner) && e.Damage <= 0) return; if (self.World.FrameNumber - lastAttackTime > info.NotifyInterval * 25)