diff --git a/Pathfinding/PathNode.cs b/Pathfinding/PathNode.cs index b5af0b0..9d8ef44 100644 --- a/Pathfinding/PathNode.cs +++ b/Pathfinding/PathNode.cs @@ -24,7 +24,7 @@ public class PathNode : OsmNode PathNode retNode = new PathNode(node.nodeId, node.coordinates) { currentPathLength = node.currentPathLength, - currentPathWeight = node.currentPathWeight, + currentPathWeight = double.IsPositiveInfinity(node.currentPathWeight) ? double.MaxValue : node.currentPathWeight, directDistanceToGoal = node.directDistanceToGoal }; return retNode; diff --git a/Pathfinding/Pathfinder_Distance.cs b/Pathfinding/Pathfinder_Distance.cs index 3e66471..485dfeb 100644 --- a/Pathfinding/Pathfinder_Distance.cs +++ b/Pathfinding/Pathfinder_Distance.cs @@ -32,8 +32,6 @@ public static partial class Pathfinder { neighbor.previousPathNode = closestNodeToGoal; neighbor.currentPathLength = newPotentialLength; - neighbor.currentPathWeight = closestNodeToGoal.currentPathWeight + - EdgeWeight(closestNodeToGoal, edge, Tag.SpeedType.road, regionManager); neighbor.directDistanceToGoal = Utils.DistanceBetween(neighbor, goalNode); if (neighbor.Equals(goalNode))