From ce4d263b52ad683f0259e780fd8002d1bbeb334a Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Sat, 12 Sep 2020 15:19:01 +0200 Subject: [PATCH] Fix AttackMove getting unarmed units stuck --- OpenRA.Mods.Common/Activities/Move/AttackMoveActivity.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Activities/Move/AttackMoveActivity.cs b/OpenRA.Mods.Common/Activities/Move/AttackMoveActivity.cs index da49560729..150d600dd4 100644 --- a/OpenRA.Mods.Common/Activities/Move/AttackMoveActivity.cs +++ b/OpenRA.Mods.Common/Activities/Move/AttackMoveActivity.cs @@ -39,8 +39,11 @@ namespace OpenRA.Mods.Common.Activities protected override void OnFirstRun(Actor self) { - if (attackMove == null) + if (attackMove == null || autoTarget == null) + { + QueueChild(getMove()); return; + } if (isAssaultMove) token = self.GrantCondition(attackMove.Info.AssaultMoveCondition); @@ -50,11 +53,11 @@ namespace OpenRA.Mods.Common.Activities public override bool Tick(Actor self) { - if (IsCanceling) + if (IsCanceling || attackMove == null || autoTarget == null) return TickChild(self); // We are currently not attacking, so scan for new targets. - if (autoTarget != null && (ChildActivity == null || runningMoveActivity)) + if (ChildActivity == null || runningMoveActivity) { // Use the standard ScanForTarget rate limit while we are running the move activity to save performance. // Override the rate limit if our attack activity has completed so we can immediately acquire a new target instead of moving.