Use Util.AdjacentCells to determine ExternalCapture validity.
This matches the set of cells targeted by MoveAdjacentTo.
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
using System.Linq;
|
||||||
using OpenRA.Activities;
|
using OpenRA.Activities;
|
||||||
using OpenRA.Mods.Common.Effects;
|
using OpenRA.Mods.Common.Effects;
|
||||||
using OpenRA.Mods.Common.Traits;
|
using OpenRA.Mods.Common.Traits;
|
||||||
@@ -42,9 +43,7 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
return NextActivity;
|
return NextActivity;
|
||||||
}
|
}
|
||||||
|
|
||||||
var nearest = target.Actor.OccupiesSpace.NearestCellTo(mobile.ToCell);
|
if (!Util.AdjacentCells(self.World, target).Contains(mobile.ToCell))
|
||||||
|
|
||||||
if ((nearest - mobile.ToCell).LengthSquared > 2)
|
|
||||||
return ActivityUtils.SequenceActivities(new MoveAdjacentTo(self, target), this);
|
return ActivityUtils.SequenceActivities(new MoveAdjacentTo(self, target), this);
|
||||||
|
|
||||||
if (!capturable.CaptureInProgress)
|
if (!capturable.CaptureInProgress)
|
||||||
|
|||||||
Reference in New Issue
Block a user