summaryrefslogtreecommitdiff
path: root/src/pathfinder/yapf/yapf_road.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pathfinder/yapf/yapf_road.cpp')
-rw-r--r--src/pathfinder/yapf/yapf_road.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pathfinder/yapf/yapf_road.cpp b/src/pathfinder/yapf/yapf_road.cpp
index 9d42f622d..98cd889c9 100644
--- a/src/pathfinder/yapf/yapf_road.cpp
+++ b/src/pathfinder/yapf/yapf_road.cpp
@@ -161,8 +161,8 @@ public:
int min_speed = 0;
int max_veh_speed = v->GetDisplayMaxSpeed();
int max_speed = F.GetSpeedLimit(&min_speed);
- if (max_speed < max_veh_speed) segment_cost += 1 * (max_veh_speed - max_speed);
- if (min_speed > max_veh_speed) segment_cost += 10 * (min_speed - max_veh_speed);
+ if (max_speed < max_veh_speed) segment_cost += YAPF_TILE_LENGTH * (max_veh_speed - max_speed) * (4 + F.m_tiles_skipped) / max_veh_speed;
+ if (min_speed > max_veh_speed) segment_cost += YAPF_TILE_LENGTH * (min_speed - max_veh_speed);
/* move to the next tile */
tile = F.m_new_tile;