Fix Move not cancelling during turns.
This commit is contained in:
@@ -259,6 +259,14 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
return Pair.New(nextCell, subCell);
|
return Pair.New(nextCell, subCell);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void Cancel(Actor self, bool keepQueue = false)
|
||||||
|
{
|
||||||
|
if (path != null)
|
||||||
|
path.Clear();
|
||||||
|
|
||||||
|
base.Cancel(self, keepQueue);
|
||||||
|
}
|
||||||
|
|
||||||
public override IEnumerable<Target> GetTargets(Actor self)
|
public override IEnumerable<Target> GetTargets(Actor self)
|
||||||
{
|
{
|
||||||
if (path != null)
|
if (path != null)
|
||||||
@@ -401,8 +409,6 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
var fromSubcellOffset = map.Grid.OffsetOfSubCell(mobile.FromSubCell);
|
var fromSubcellOffset = map.Grid.OffsetOfSubCell(mobile.FromSubCell);
|
||||||
var toSubcellOffset = map.Grid.OffsetOfSubCell(mobile.ToSubCell);
|
var toSubcellOffset = map.Grid.OffsetOfSubCell(mobile.ToSubCell);
|
||||||
|
|
||||||
if (!IsCanceling || self.Location.Layer == CustomMovementLayerType.Tunnel)
|
|
||||||
{
|
|
||||||
var nextCell = parent.PopPath(self);
|
var nextCell = parent.PopPath(self);
|
||||||
if (nextCell != null)
|
if (nextCell != null)
|
||||||
{
|
{
|
||||||
@@ -424,7 +430,6 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
|
|
||||||
parent.path.Add(nextCell.Value.First);
|
parent.path.Add(nextCell.Value.First);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
var toPos = mobile.ToCell.Layer == 0 ? map.CenterOfCell(mobile.ToCell) :
|
var toPos = mobile.ToCell.Layer == 0 ? map.CenterOfCell(mobile.ToCell) :
|
||||||
self.World.GetCustomMovementLayers()[mobile.ToCell.Layer].CenterOfCell(mobile.ToCell);
|
self.World.GetCustomMovementLayers()[mobile.ToCell.Layer].CenterOfCell(mobile.ToCell);
|
||||||
|
|||||||
Reference in New Issue
Block a user