Disallow attack-moving units from chasing their targets.
This commit is contained in:
@@ -56,14 +56,14 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
if (!IsCanceling && ChildActivity != null && ChildActivity.NextActivity == null && autoTarget != null)
|
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.
|
// 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)
|
if (target.Type != TargetType.Invalid)
|
||||||
{
|
{
|
||||||
// We have found a target so cancel the current move activity and queue attack activities.
|
// We have found a target so cancel the current move activity and queue attack activities.
|
||||||
ChildActivity.Cancel(self);
|
ChildActivity.Cancel(self);
|
||||||
var attackBases = autoTarget.ActiveAttackBases;
|
var attackBases = autoTarget.ActiveAttackBases;
|
||||||
foreach (var ab in attackBases)
|
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.
|
// Make sure to continue moving when the attack activities have finished.
|
||||||
QueueChild(getInner());
|
QueueChild(getInner());
|
||||||
|
|||||||
Reference in New Issue
Block a user