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
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,7 +81,6 @@ namespace OpenRA.Mods.Common
return Target.FromActor(t.FrozenActor.Actor);
// Original actor was killed while hidden
if (t.Actor == null)
return Target.Invalid;
}
}