Disallow attack-moving units from chasing their targets.

This commit is contained in:
tovl
2019-08-13 00:45:26 +02:00
committed by reaperrr
parent 441585b3aa
commit 08c472b2e2

View File

@@ -56,14 +56,14 @@ namespace OpenRA.Mods.Common.Activities
if (!IsCanceling && ChildActivity != null && ChildActivity.NextActivity == null && autoTarget != null)
{
// ScanForTarget already limits the scanning rate for performance so we don't need to do that here.
var target = autoTarget.ScanForTarget(self, true, true);
var target = autoTarget.ScanForTarget(self, false, true);
if (target.Type != TargetType.Invalid)
{
// We have found a target so cancel the current move activity and queue attack activities.
ChildActivity.Cancel(self);
var attackBases = autoTarget.ActiveAttackBases;
foreach (var ab in attackBases)
QueueChild(ab.GetAttackActivity(self, target, true, false));
QueueChild(ab.GetAttackActivity(self, target, false, false));
// Make sure to continue moving when the attack activities have finished.
QueueChild(getInner());