Include tunnel check in CanStayInCell.
This commit is contained in:
@@ -158,9 +158,7 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
{
|
{
|
||||||
mobile.TurnToMove = false;
|
mobile.TurnToMove = false;
|
||||||
|
|
||||||
// If the actor is inside a tunnel then we must let them move
|
if (IsCanceling && mobile.CanStayInCell(mobile.ToCell))
|
||||||
// all the way through before moving to the next activity
|
|
||||||
if (IsCanceling && self.Location.Layer != CustomMovementLayerType.Tunnel && mobile.CanStayInCell(mobile.ToCell))
|
|
||||||
{
|
{
|
||||||
if (path != null)
|
if (path != null)
|
||||||
path.Clear();
|
path.Clear();
|
||||||
|
|||||||
@@ -109,6 +109,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
locomotor = world.WorldActor.TraitsImplementing<Locomotor>()
|
locomotor = world.WorldActor.TraitsImplementing<Locomotor>()
|
||||||
.SingleOrDefault(l => l.Info.Name == Locomotor);
|
.SingleOrDefault(l => l.Info.Name == Locomotor);
|
||||||
|
|
||||||
|
if (cell.Layer == CustomMovementLayerType.Tunnel)
|
||||||
|
return false;
|
||||||
|
|
||||||
return locomotor.CanStayInCell(cell);
|
return locomotor.CanStayInCell(cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user