From 30cafcbc25a9f74a6a8d3909f4c0f883f80f76dc Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 17 Dec 2017 12:31:55 +0000 Subject: [PATCH] Use Util.AdjacentCells to determine ExternalCapture validity. This matches the set of cells targeted by MoveAdjacentTo. --- OpenRA.Mods.Common/Activities/ExternalCaptureActor.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Activities/ExternalCaptureActor.cs b/OpenRA.Mods.Common/Activities/ExternalCaptureActor.cs index c0253b3ef9..7a2b3d3780 100644 --- a/OpenRA.Mods.Common/Activities/ExternalCaptureActor.cs +++ b/OpenRA.Mods.Common/Activities/ExternalCaptureActor.cs @@ -9,6 +9,7 @@ */ #endregion +using System.Linq; using OpenRA.Activities; using OpenRA.Mods.Common.Effects; using OpenRA.Mods.Common.Traits; @@ -42,9 +43,7 @@ namespace OpenRA.Mods.Common.Activities return NextActivity; } - var nearest = target.Actor.OccupiesSpace.NearestCellTo(mobile.ToCell); - - if ((nearest - mobile.ToCell).LengthSquared > 2) + if (!Util.AdjacentCells(self.World, target).Contains(mobile.ToCell)) return ActivityUtils.SequenceActivities(new MoveAdjacentTo(self, target), this); if (!capturable.CaptureInProgress)