Include tunnel check in CanStayInCell.

This commit is contained in:
tovl
2019-10-01 20:38:48 +02:00
committed by Paul Chote
parent 196d9670d3
commit 2094142b7d
2 changed files with 4 additions and 3 deletions

View File

@@ -158,9 +158,7 @@ namespace OpenRA.Mods.Common.Activities
{
mobile.TurnToMove = false;
// If the actor is inside a tunnel then we must let them move
// all the way through before moving to the next activity
if (IsCanceling && self.Location.Layer != CustomMovementLayerType.Tunnel && mobile.CanStayInCell(mobile.ToCell))
if (IsCanceling && mobile.CanStayInCell(mobile.ToCell))
{
if (path != null)
path.Clear();

View File

@@ -109,6 +109,9 @@ namespace OpenRA.Mods.Common.Traits
locomotor = world.WorldActor.TraitsImplementing<Locomotor>()
.SingleOrDefault(l => l.Info.Name == Locomotor);
if (cell.Layer == CustomMovementLayerType.Tunnel)
return false;
return locomotor.CanStayInCell(cell);
}