Checks to make sure Attacker is not null.

Ignores self-attacking.
Ignores friendly-fire that does <= 0 damage (repairs).
This commit is contained in:
Taryn Hill
2013-10-30 23:04:21 -04:00
parent 878e03adb9
commit dd17a99ab5

View File

@@ -37,8 +37,13 @@ namespace OpenRA.Mods.RA
if (!self.HasTrait<Building>())
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)