summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--settings.c1
-rw-r--r--yapf/yapf_road.cpp2
-rw-r--r--yapf/yapf_settings.h1
3 files changed, 3 insertions, 1 deletions
diff --git a/settings.c b/settings.c
index 00ba5cdc0..df580faa7 100644
--- a/settings.c
+++ b/settings.c
@@ -1433,6 +1433,7 @@ const SettingDesc _patch_settings[] = {
SDT_CONDVAR (Patches, yapf.rail_shorter_platform_per_tile_penalty, SLE_UINT, 28, SL_MAX_VERSION,NS, 0, 0 * YAPF_TILE_LENGTH, 0, 20000, STR_NULL, NULL),
// road vehicles - penalties
SDT_CONDVAR (Patches, yapf.road_slope_penalty , SLE_UINT, 28, SL_MAX_VERSION,NS, 0, 2 * YAPF_TILE_LENGTH, 0, 1000000, STR_NULL, NULL),
+ SDT_CONDVAR (Patches, yapf.road_curve_penalty , SLE_UINT, 28, SL_MAX_VERSION,NS, 0, 1 * YAPF_TILE_LENGTH, 0, 1000000, STR_NULL, NULL),
SDT_CONDVAR (Patches, yapf.road_crossing_penalty , SLE_UINT, 28, SL_MAX_VERSION,NS, 0, 3 * YAPF_TILE_LENGTH, 0, 1000000, STR_NULL, NULL),
/***************************************************************************/
diff --git a/yapf/yapf_road.cpp b/yapf/yapf_road.cpp
index cb6233e0e..1b9000f13 100644
--- a/yapf/yapf_road.cpp
+++ b/yapf/yapf_road.cpp
@@ -57,7 +57,7 @@ protected:
}
} else {
// non-diagonal trackdir
- cost = YAPF_TILE_CORNER_LENGTH;
+ cost = YAPF_TILE_CORNER_LENGTH + Yapf().PfGetSettings().road_curve_penalty;
}
return cost;
}
diff --git a/yapf/yapf_settings.h b/yapf/yapf_settings.h
index aa87ab9d6..724196ac2 100644
--- a/yapf/yapf_settings.h
+++ b/yapf/yapf_settings.h
@@ -37,6 +37,7 @@ YS_DEF_BEGIN
YS_DEF(bool , road_use_yapf) ///< use YAPF for road
YS_DEF(bool , rail_use_yapf) ///< use YAPF for rail
YS_DEF(uint32, road_slope_penalty) ///< penalty for up-hill slope
+ YS_DEF(uint32, road_curve_penalty) ///< penalty for curves
YS_DEF(uint32, road_crossing_penalty) ///< penalty for level crossing
YS_DEF(bool , rail_firstred_twoway_eol) ///< treat first red two-way signal as dead end
YS_DEF(uint32, rail_firstred_penalty) ///< penalty for first red signal