summaryrefslogtreecommitdiff
path: root/yapf
diff options
context:
space:
mode:
authorKUDr <kudr@openttd.org>2006-08-27 07:23:46 +0000
committerKUDr <kudr@openttd.org>2006-08-27 07:23:46 +0000
commitd3096b84fdab85a0688eff8f3a6d1d2618d3162d (patch)
treed46e216ab6a16f351ceffa9c175e99c32879e41a /yapf
parentbb30f580a4bc6bebc2908fe61dff0912a18e6655 (diff)
downloadopenttd-d3096b84fdab85a0688eff8f3a6d1d2618d3162d.tar.xz
(svn r6164) -Fix [YAPF]: Road vehicles preferring bends - added yapf.road_curve_penalty setting with default value 100 (=YAPF_TILE_LENGTH) that is saved only in MP games (mart3p)
Diffstat (limited to 'yapf')
-rw-r--r--yapf/yapf_road.cpp2
-rw-r--r--yapf/yapf_settings.h1
2 files changed, 2 insertions, 1 deletions
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