move the null check up further to catch everything

This commit is contained in:
Matthias Mailänder
2015-05-31 15:36:48 +02:00
parent a12e6a191b
commit f171b23a1b

View File

@@ -926,7 +926,7 @@ namespace OpenRA.Mods.Common.AI
public void Damaged(Actor self, AttackInfo e) public void Damaged(Actor self, AttackInfo e)
{ {
if (!enabled) if (!enabled || e.Attacker == null)
return; return;
if (e.Attacker.Owner.Stances[self.Owner] == Stance.Neutral) if (e.Attacker.Owner.Stances[self.Owner] == Stance.Neutral)
@@ -950,7 +950,7 @@ namespace OpenRA.Mods.Common.AI
if (!e.Attacker.HasTrait<ITargetable>()) if (!e.Attacker.HasTrait<ITargetable>())
return; return;
if (e.Attacker != null && e.Damage > 0) if (e.Damage > 0)
aggro[e.Attacker.Owner].Aggro += e.Damage; aggro[e.Attacker.Owner].Aggro += e.Damage;
// Protected harvesters or building // Protected harvesters or building