Prevent movement pausing at invalid position.
This commit is contained in:
@@ -210,6 +210,13 @@ namespace OpenRA.Mods.Common.Activities
|
||||
|
||||
var nextCell = path[path.Count - 1];
|
||||
|
||||
// Something else might have moved us, so the path is no longer valid.
|
||||
if (!Util.AreAdjacentCells(mobile.ToCell, nextCell))
|
||||
{
|
||||
path = EvalPath(BlockedByActor.Immovable);
|
||||
return null;
|
||||
}
|
||||
|
||||
var containsTemporaryBlocker = WorldUtils.ContainsTemporaryBlocker(self.World, nextCell, self);
|
||||
|
||||
// Next cell in the move is blocked by another actor
|
||||
@@ -407,9 +414,6 @@ namespace OpenRA.Mods.Common.Activities
|
||||
|
||||
public override bool Tick(Actor self)
|
||||
{
|
||||
if (Move.mobile.IsTraitDisabled || Move.mobile.IsTraitPaused)
|
||||
return false;
|
||||
|
||||
var ret = InnerTick(self, Move.mobile);
|
||||
|
||||
if (moveFraction > MoveFractionTotal)
|
||||
@@ -491,7 +495,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
var nextCell = parent.PopPath(self);
|
||||
if (nextCell != null)
|
||||
{
|
||||
if (IsTurn(mobile, nextCell.Value.First, map))
|
||||
if (!mobile.IsTraitPaused && !mobile.IsTraitDisabled && IsTurn(mobile, nextCell.Value.First, map))
|
||||
{
|
||||
var nextSubcellOffset = map.Grid.OffsetOfSubCell(nextCell.Value.Second);
|
||||
var ret = new MoveFirstHalf(
|
||||
|
||||
Reference in New Issue
Block a user