From e805461be7e6414b1d72ee0a048fa05892081cb4 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 18 Jul 2014 23:17:50 +1200 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20cancel=20MoveAdjacentTo=20/=20M?= =?UTF-8?q?oveWithinRange=20when=20target=20becomes=20invalid.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move to the last known position instead. Fixes #5968. --- OpenRA.Mods.RA/Activities/MoveAdjacentTo.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/OpenRA.Mods.RA/Activities/MoveAdjacentTo.cs b/OpenRA.Mods.RA/Activities/MoveAdjacentTo.cs index b488b5ce90..373f719ac2 100755 --- a/OpenRA.Mods.RA/Activities/MoveAdjacentTo.cs +++ b/OpenRA.Mods.RA/Activities/MoveAdjacentTo.cs @@ -17,12 +17,12 @@ namespace OpenRA.Mods.RA.Activities { public class MoveAdjacentTo : Activity { - protected readonly Target target; readonly Mobile mobile; readonly PathFinder pathFinder; readonly DomainIndex domainIndex; readonly uint movementClass; + protected Target target { get; private set; } protected CPos targetPosition; Activity inner; bool repath; @@ -87,10 +87,8 @@ namespace OpenRA.Mods.RA.Activities } else { - // Target became invalid. Cancel the inner order, - // and then wait for it to move into the next cell - // before finishing this order (handled above). - inner.Cancel(self); + // Target became invalid. Move to its last known position. + target = Target.FromCell(self.World, targetPosition); } // Ticks the inner move activity to actually move the actor.