diff --git a/Pathfinding/Pathfinder.cs b/Pathfinding/Pathfinder.cs index 018d916..ab10667 100644 --- a/Pathfinding/Pathfinder.cs +++ b/Pathfinding/Pathfinder.cs @@ -140,6 +140,8 @@ public class Pathfinder double speed = regionManager.GetSpeedForEdge(currentNode, edge.wayId, _speedType); + double roadPriority = priority * roadPriorityFactor; + double angle = 0; if (_cameFromDict!.ContainsKey(currentNode)) { @@ -153,7 +155,6 @@ public class Pathfinder angle = nodeAngle / 180; } - double roadPriority = priority * roadPriorityFactor; return distance / (speed * angle + roadPriority + 1); }