Fixed infinity error JSON

This commit is contained in:
glax 2023-04-09 17:02:56 +02:00
parent 5efec08bbc
commit 9c7fec1c37
2 changed files with 1 additions and 3 deletions

View File

@ -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;

View File

@ -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))