Pathing considers reachability of source cells consistently.
Using the local pathfinder, you could not find a path to an unreachable destination cell, but it was possible to find a path from an unreachable source cell if there was a reachable cells adjacent to it. The hierarchical pathfinder did not have this behaviour and considering an unreachable source cell to block attempts to find a path. Now, we unify the pathfinders to use a consistent behaviour, allowing paths from unreachable source cells to be found.
This commit is contained in:
@@ -124,10 +124,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
locomotor = world.WorldActor.TraitsImplementing<Locomotor>()
|
||||
.SingleOrDefault(l => l.Info.Name == Locomotor);
|
||||
|
||||
if (locomotor.MovementCostForCell(cell) == PathGraph.MovementCostForUnreachableCell)
|
||||
return false;
|
||||
|
||||
return locomotor.CanMoveFreelyInto(self, cell, subCell, check, ignoreActor);
|
||||
return locomotor.MovementCostToEnterCell(
|
||||
self, cell, check, ignoreActor, subCell) != PathGraph.MovementCostForUnreachableCell;
|
||||
}
|
||||
|
||||
public bool CanStayInCell(World world, CPos cell)
|
||||
|
||||
Reference in New Issue
Block a user