changed speeds and return type to byte

This commit is contained in:
2023-04-09 19:22:34 +02:00
parent 9448187452
commit 6e836db79b
3 changed files with 20 additions and 28 deletions

View File

@ -25,10 +25,8 @@ public static partial class Pathfinder
if (node2 is null)
return double.MaxValue;
double distance = Utils.DistanceBetween(node1, node2);
double speed = regionManager.GetSpeedForEdge(node1, edge.wayId, vehicle);
if (speed is 0)
return double.MaxValue;
return distance / speed;
byte speed = regionManager.GetSpeedForEdge(node1, edge.wayId, vehicle);
return speed is 0 ? double.MaxValue : distance / speed;
}
private static List<PathNode> GetRouteFromCalc(OsmNode goalNode, RegionManager regionManager)