Use named pathfinding constants.
- Rename CostForInvalidCell to PathCostForInvalidPath - Add MovementCostForUnreachableCell - Update usages of int.MaxValue and short.Maxvalue to use named constants where relevant. - Update costs on ICustomMovementLayer to return short, for consistency with costs from Locomotor. - Rename some methods to distinguish between path/movement cost.
This commit is contained in:
@@ -108,7 +108,7 @@ namespace OpenRA.Mods.Common.Pathfinder
|
||||
var currentCell = Graph[currentMinNode];
|
||||
Graph[currentMinNode] = new CellInfo(currentCell.CostSoFar, currentCell.EstimatedTotal, currentCell.PreviousPos, CellStatus.Closed);
|
||||
|
||||
if (Graph.CustomCost != null && Graph.CustomCost(currentMinNode) == PathGraph.CostForInvalidCell)
|
||||
if (Graph.CustomCost != null && Graph.CustomCost(currentMinNode) == PathGraph.PathCostForInvalidPath)
|
||||
return currentMinNode;
|
||||
|
||||
foreach (var connection in Graph.GetConnections(currentMinNode))
|
||||
|
||||
Reference in New Issue
Block a user