(svn r4812) -Fix (FS#161) NTP properly checks for railtypes on non-plain-rail-tiles (Rubidium)

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
celestar 18 years ago
parent d2fc3431a1
commit 3c6c3895cf

@ -699,6 +699,10 @@ start_at:
// We are not driving into the tunnel, or it is an invalid tunnel
continue;
}
if (!HASBIT(tpf->railtypes, GetRailType(tile))) {
bits = 0;
break;
}
flotr = FindLengthOfTunnel(tile, direction);
si.cur_length += flotr.length * DIAG_FACTOR;
tile = flotr.tile;
@ -730,6 +734,12 @@ start_at:
// Check that the tile contains exactly one track
if (bits == 0 || KILL_FIRST_BIT(bits) != 0) break;
if ((IsTileType(tile, MP_STREET) && !HASBIT(tpf->railtypes, GetRailTypeCrossing(tile))) ||
!HASBIT(tpf->railtypes, GetRailType(tile))) {
bits = 0;
break;
}
///////////////////
// If we reach here, the tile has exactly one track.
// tile - index to a tile that is not rail tile, but still straight (with optional signals)

Loading…
Cancel
Save