Let AI ignore frozen actors and target original actors instead.

This commit is contained in:
matjaeck
2019-11-01 17:17:02 +01:00
committed by reaperrr
parent d2819dca77
commit 900e857bfa

View File

@@ -42,7 +42,20 @@ namespace OpenRA.Mods.Common
// Bot-controlled units aren't yet capable of understanding visibility changes // Bot-controlled units aren't yet capable of understanding visibility changes
if (viewer.IsBot) 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; return t;
}
if (t.Type == TargetType.Actor) if (t.Type == TargetType.Actor)
{ {
@@ -68,8 +81,7 @@ namespace OpenRA.Mods.Common
return Target.FromActor(t.FrozenActor.Actor); return Target.FromActor(t.FrozenActor.Actor);
// Original actor was killed while hidden // Original actor was killed while hidden
if (t.Actor == null) return Target.Invalid;
return Target.Invalid;
} }
} }