From f171b23a1bb8405d8fbfbc8c0a85ce7161a10cce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 31 May 2015 15:36:48 +0200 Subject: [PATCH] move the null check up further to catch everything --- OpenRA.Mods.Common/AI/HackyAI.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/AI/HackyAI.cs b/OpenRA.Mods.Common/AI/HackyAI.cs index 1de4747a55..e3750ffa02 100644 --- a/OpenRA.Mods.Common/AI/HackyAI.cs +++ b/OpenRA.Mods.Common/AI/HackyAI.cs @@ -926,7 +926,7 @@ namespace OpenRA.Mods.Common.AI public void Damaged(Actor self, AttackInfo e) { - if (!enabled) + if (!enabled || e.Attacker == null) return; if (e.Attacker.Owner.Stances[self.Owner] == Stance.Neutral) @@ -950,7 +950,7 @@ namespace OpenRA.Mods.Common.AI if (!e.Attacker.HasTrait()) return; - if (e.Attacker != null && e.Damage > 0) + if (e.Damage > 0) aggro[e.Attacker.Owner].Aggro += e.Damage; // Protected harvesters or building