(svn r7655) [cbh] - Fix: [YAPF] another assert (on opposite cbh when it contained choice). Now it is possible to reach choice when exiting wormhole. So the wormhole cost must be taken into consideration when starting new YAPF node.
--- a/yapf/yapf_costrail.hpp Sat Dec 30 17:35:08 2006 +0000
+++ b/yapf/yapf_costrail.hpp Sat Dec 30 18:25:01 2006 +0000
@@ -191,6 +191,12 @@
RailType rail_type = GetTileRailType(tile, trackdir);
+ // detect exit from bridge wormhole
+ if (IsBridgeTile(tile) && TrackdirToExitdir(ReverseTrackdir(trackdir)) == GetBridgeRampDirection(tile)) {
+ // we are jumping over bridge (possible now with custom bridge heads) we must add the cost of skipped tiles
+ segment_cost += (DistanceManhattan(prev_tile, tile) - 1) * YAPF_TILE_LENGTH;
+ }
+
bool target_seen = Yapf().PfDetectDestination(tile, trackdir);
while (true) {