Don’t cancel MoveAdjacentTo / MoveWithinRange when target becomes invalid.
Move to the last known position instead. Fixes #5968.
This commit is contained in:
@@ -17,12 +17,12 @@ namespace OpenRA.Mods.RA.Activities
|
|||||||
{
|
{
|
||||||
public class MoveAdjacentTo : Activity
|
public class MoveAdjacentTo : Activity
|
||||||
{
|
{
|
||||||
protected readonly Target target;
|
|
||||||
readonly Mobile mobile;
|
readonly Mobile mobile;
|
||||||
readonly PathFinder pathFinder;
|
readonly PathFinder pathFinder;
|
||||||
readonly DomainIndex domainIndex;
|
readonly DomainIndex domainIndex;
|
||||||
readonly uint movementClass;
|
readonly uint movementClass;
|
||||||
|
|
||||||
|
protected Target target { get; private set; }
|
||||||
protected CPos targetPosition;
|
protected CPos targetPosition;
|
||||||
Activity inner;
|
Activity inner;
|
||||||
bool repath;
|
bool repath;
|
||||||
@@ -87,10 +87,8 @@ namespace OpenRA.Mods.RA.Activities
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Target became invalid. Cancel the inner order,
|
// Target became invalid. Move to its last known position.
|
||||||
// and then wait for it to move into the next cell
|
target = Target.FromCell(self.World, targetPosition);
|
||||||
// before finishing this order (handled above).
|
|
||||||
inner.Cancel(self);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ticks the inner move activity to actually move the actor.
|
// Ticks the inner move activity to actually move the actor.
|
||||||
|
|||||||
Reference in New Issue
Block a user