diff options
author | KUDr <kudr@openttd.org> | 2006-06-01 21:00:59 +0000 |
---|---|---|
committer | KUDr <kudr@openttd.org> | 2006-06-01 21:00:59 +0000 |
commit | 76a8f036df11a961a286dc4d5447a090a35bf4aa (patch) | |
tree | 168b052560c9309b0e9546138e7f686272557e3e /yapf/yapf_costrail.hpp | |
parent | bf2fb59bf9c803c2a6cccb45c43d8c02ffcaa0e3 (diff) | |
download | openttd-76a8f036df11a961a286dc4d5447a090a35bf4aa.tar.xz |
(svn r5065) -CodeChange: [YAPF] Added PfDetectDestination(tile, trackdir) for trains (to be used by platform selection feature)
Diffstat (limited to 'yapf/yapf_costrail.hpp')
-rw-r--r-- | yapf/yapf_costrail.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/yapf/yapf_costrail.hpp b/yapf/yapf_costrail.hpp index f02a42208..6085197ab 100644 --- a/yapf/yapf_costrail.hpp +++ b/yapf/yapf_costrail.hpp @@ -165,7 +165,7 @@ public: RailType rail_type = GetTileRailType(tile, trackdir); - bool target_seen = false; + bool target_seen = Yapf().PfDetectDestination(tile, trackdir); while (true) { segment_cost += Yapf().OneTileCost(tile, trackdir); @@ -177,7 +177,6 @@ public: } // finish if we have reached the destination - target_seen = Yapf().PfDetectDestination(n); if (target_seen) { break; } @@ -237,6 +236,8 @@ public: trackdir = new_td; tile_type = GetTileType(tile); + target_seen = Yapf().PfDetectDestination(tile, trackdir); + // reversing in depot penalty if (tile == prev_tile) { segment_cost += Yapf().PfGetSettings().rail_depot_reverse_penalty; |