mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-29 01:19:11 +00:00
(svn r12348) -Fix (r7573): NTP skipped junction just after bridge end
This commit is contained in:
@@ -611,12 +611,11 @@ start_at:
|
|||||||
/* If the tile is the entry tile of a tunnel, and we're not going out of the tunnel,
|
/* If the tile is the entry tile of a tunnel, and we're not going out of the tunnel,
|
||||||
* need to find the exit of the tunnel. */
|
* need to find the exit of the tunnel. */
|
||||||
if (IsTileType(tile, MP_TUNNELBRIDGE)) {
|
if (IsTileType(tile, MP_TUNNELBRIDGE)) {
|
||||||
if (IsTunnel(tile)) {
|
|
||||||
if (GetTunnelBridgeDirection(tile) != ReverseDiagDir(direction)) {
|
if (GetTunnelBridgeDirection(tile) != ReverseDiagDir(direction)) {
|
||||||
/* We are not just driving out of the tunnel */
|
/* We are not just driving out of the tunnel/bridge */
|
||||||
if (GetTunnelBridgeDirection(tile) != direction ||
|
if (GetTunnelBridgeDirection(tile) != direction ||
|
||||||
GetTunnelBridgeTransportType(tile) != tpf->tracktype) {
|
GetTunnelBridgeTransportType(tile) != tpf->tracktype) {
|
||||||
/* We are not driving into the tunnel, or it is an invalid tunnel */
|
/* We are not driving into the tunnel/bridge, or it is an invalid tunnel/bridge */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!HasBit(tpf->railtypes, GetRailType(tile))) {
|
if (!HasBit(tpf->railtypes, GetRailType(tile))) {
|
||||||
@@ -624,24 +623,10 @@ start_at:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
TileIndex endtile = GetOtherTunnelEnd(tile);
|
TileIndex endtile = GetOtherTunnelBridgeEnd(tile);
|
||||||
si.cur_length += DIAG_FACTOR * (GetTunnelBridgeLength(tile, endtile) + 1);
|
si.cur_length += DIAG_FACTOR * (GetTunnelBridgeLength(tile, endtile) + 1);
|
||||||
tile = endtile;
|
tile = endtile;
|
||||||
/* tile now points to the exit tile of the tunnel */
|
/* tile now points to the exit tile of the tunnel/bridge */
|
||||||
}
|
|
||||||
} else { // IsBridge(tile)
|
|
||||||
TileIndex tile_end;
|
|
||||||
if (GetTunnelBridgeDirection(tile) != ReverseDiagDir(direction)) {
|
|
||||||
/* We are not just leaving the bridge */
|
|
||||||
if (GetTunnelBridgeDirection(tile) != direction ||
|
|
||||||
GetTunnelBridgeTransportType(tile) != tpf->tracktype) {
|
|
||||||
/* Not entering the bridge or not compatible */
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tile_end = GetOtherBridgeEnd(tile);
|
|
||||||
si.cur_length += DIAG_FACTOR * (GetTunnelBridgeLength(tile, tile_end) + 1);
|
|
||||||
tile = tile_end;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user