Merge pull request #8735 from reaperrr/safe-pf-changes
Minor pathfinder-related changes (preparation for mobile refactor)
This commit is contained in:
@@ -81,7 +81,7 @@ namespace OpenRA.Mods.Common.Pathfinder
|
||||
if (string.IsNullOrEmpty(id))
|
||||
{
|
||||
var builder = new StringBuilder();
|
||||
builder.Append(this.Graph.Actor.ActorID);
|
||||
builder.Append(Graph.Actor.ActorID);
|
||||
while (!startPoints.Empty)
|
||||
{
|
||||
var startpoint = startPoints.Pop();
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace OpenRA.Mods.Common.Pathfinder
|
||||
{
|
||||
defaultCellInfoLayer =
|
||||
CellLayer<CellInfo>.CreateInstance(
|
||||
mpos => new CellInfo(int.MaxValue, int.MaxValue, mpos.ToCPos(map as Map), CellStatus.Unvisited),
|
||||
mpos => new CellInfo(int.MaxValue, int.MaxValue, mpos.ToCPos(map), CellStatus.Unvisited),
|
||||
new Size(map.MapSize.X, map.MapSize.Y),
|
||||
map.TileShape);
|
||||
}
|
||||
|
||||
@@ -73,8 +73,6 @@ namespace OpenRA.Mods.Common.Pathfinder
|
||||
readonly MobileInfo mobileInfo;
|
||||
CellLayer<CellInfo> cellInfo;
|
||||
|
||||
public const int InvalidNode = int.MaxValue;
|
||||
|
||||
public PathGraph(CellLayer<CellInfo> cellInfo, MobileInfo mobileInfo, Actor actor, World world, bool checkForBlocked)
|
||||
{
|
||||
this.cellInfo = cellInfo;
|
||||
@@ -127,11 +125,11 @@ namespace OpenRA.Mods.Common.Pathfinder
|
||||
{
|
||||
int movementCost;
|
||||
if (mobileInfo.CanEnterCell(
|
||||
World as World,
|
||||
Actor as Actor,
|
||||
World,
|
||||
Actor,
|
||||
destNode,
|
||||
out movementCost,
|
||||
IgnoredActor as Actor,
|
||||
IgnoredActor,
|
||||
checkConditions) && !(CustomBlock != null && CustomBlock(destNode)))
|
||||
{
|
||||
return CalculateCellCost(destNode, direction, movementCost);
|
||||
|
||||
Reference in New Issue
Block a user