(svn r14024) -Fix (r14019) [YAPP]: YAPF also skips tunnels and bridges. Honor that in penalty calculations. (michi_cc)
authorsmatz
Fri, 08 Aug 2008 15:02:21 +0000
changeset 9877 202f912c4610
parent 9876 028c6ca56e6e
child 9878 8142e032b4e0
(svn r14024) -Fix (r14019) [YAPP]: YAPF also skips tunnels and bridges. Honor that in penalty calculations. (michi_cc)
src/yapf/yapf_costrail.hpp
--- a/src/yapf/yapf_costrail.hpp	Fri Aug 08 14:58:27 2008 +0000
+++ b/src/yapf/yapf_costrail.hpp	Fri Aug 08 15:02:21 2008 +0000
@@ -159,7 +159,7 @@
 		} else if (TrackOverlapsTracks(GetReservedTrackbits(tile), TrackdirToTrack(trackdir))) {
 			int cost = Yapf().PfGetSettings().rail_pbs_cross_penalty;
 			if (!IsDiagonalTrackdir(trackdir)) cost = (cost * YAPF_TILE_CORNER_LENGTH) / YAPF_TILE_LENGTH;
-			return cost;
+			return cost * (skipped + 1);
 		}
 		return 0;
 	}