diff --git a/OpenRA.Mods.Common/TargetExtensions.cs b/OpenRA.Mods.Common/TargetExtensions.cs index 745aa7cc60..7e0c0df63b 100644 --- a/OpenRA.Mods.Common/TargetExtensions.cs +++ b/OpenRA.Mods.Common/TargetExtensions.cs @@ -42,7 +42,20 @@ namespace OpenRA.Mods.Common // Bot-controlled units aren't yet capable of understanding visibility changes if (viewer.IsBot) + { + // Prevent that bot-controlled units endlessly fire at frozen actors. + // TODO: Teach the AI to support long range artillery units with units that provide line of sight + if (t.Type == TargetType.FrozenActor) + { + if (t.FrozenActor.Actor != null) + return Target.FromActor(t.FrozenActor.Actor); + + // Original actor was killed + return Target.Invalid; + } + return t; + } if (t.Type == TargetType.Actor) { @@ -68,8 +81,7 @@ namespace OpenRA.Mods.Common return Target.FromActor(t.FrozenActor.Actor); // Original actor was killed while hidden - if (t.Actor == null) - return Target.Invalid; + return Target.Invalid; } }