(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)
authorKUDr
Sun, 27 Aug 2006 07:23:46 +0000
changeset 4411 c8eaf5401817
parent 4410 d056b24eb9fa
child 4412 945e8a9bb89a
(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)
settings.c
yapf/yapf_road.cpp
yapf/yapf_settings.h
--- a/settings.c	Sun Aug 27 07:04:14 2006 +0000
+++ b/settings.c	Sun Aug 27 07:23:46 2006 +0000
@@ -1433,6 +1433,7 @@
 	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),
 
 	/***************************************************************************/
--- a/yapf/yapf_road.cpp	Sun Aug 27 07:04:14 2006 +0000
+++ b/yapf/yapf_road.cpp	Sun Aug 27 07:23:46 2006 +0000
@@ -57,7 +57,7 @@
 			}
 		} else {
 			// non-diagonal trackdir
-			cost = YAPF_TILE_CORNER_LENGTH;
+			cost = YAPF_TILE_CORNER_LENGTH + Yapf().PfGetSettings().road_curve_penalty;
 		}
 		return cost;
 	}
--- a/yapf/yapf_settings.h	Sun Aug 27 07:04:14 2006 +0000
+++ b/yapf/yapf_settings.h	Sun Aug 27 07:23:46 2006 +0000
@@ -37,6 +37,7 @@
 	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