From 6403c5e6af87e3b9e0b8def4b6e81a867919f5e8 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 5 Feb 2013 07:09:05 +1300 Subject: [PATCH] Fixed #2651: Units not in world should not be added to the attack force Otherwise, a pillbox's e1 passenger is counted as part of the attack force and ends up jamming HackyAI's attack logic until it is destroyed. --- OpenRA.Mods.RA/AI/HackyAI.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.RA/AI/HackyAI.cs b/OpenRA.Mods.RA/AI/HackyAI.cs index 3bd2fe32f7..248d69a8d8 100644 --- a/OpenRA.Mods.RA/AI/HackyAI.cs +++ b/OpenRA.Mods.RA/AI/HackyAI.cs @@ -281,7 +281,7 @@ namespace OpenRA.Mods.RA.AI var newUnits = self.World.ActorsWithTrait() .Where(a => a.Actor.Owner == p && !a.Actor.HasTrait() - && !activeUnits.Contains(a.Actor)) + && !activeUnits.Contains(a.Actor) && a.Actor.IsInWorld) .Select(a => a.Actor).ToArray(); foreach (var a in newUnits) @@ -489,4 +489,4 @@ namespace OpenRA.Mods.RA.AI aggro[e.Attacker.Owner].Aggro += e.Damage; } } -} \ No newline at end of file +}