Mercurial > hg > openttd
changeset 8399:48103a2817a5 draft
(svn r11969) -Codechange: documentation update, there are no 'track bits under bridge' anymore
author | smatz <smatz@openttd.org> |
---|---|
date | Wed, 23 Jan 2008 23:22:47 +0000 |
parents | a6304b304752 |
children | 9d39ea01a405 |
files | src/elrail.cpp |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/elrail.cpp +++ b/src/elrail.cpp @@ -74,8 +74,11 @@ return (TLG)((HasBit(TileX(t), 0) << 1) + HasBit(TileY(t), 0)); } -/** Finds which Rail Bits are present on a given tile. For bridge tiles, - * returns track bits under the bridge +/** + * Finds which Electrified Rail Bits are present on a given tile. + * @param t tile to check + * @param override pointer to PCP override, can be NULL + * @return trackbits of tile if it is electrified */ static TrackBits GetRailTrackBitsUniversal(TileIndex t, byte *override) { @@ -94,7 +97,7 @@ case MP_TUNNELBRIDGE: if (GetRailType(t) != RAILTYPE_ELECTRIC) return TRACK_BIT_NONE; - if (override != NULL && (IsTunnel(t) || DistanceMax(t, GetOtherBridgeEnd(t)) > 1)) { + if (override != NULL && (IsTunnel(t) || GetTunnelBridgeLength(t, GetOtherBridgeEnd(t)) > 0)) { *override = 1 << GetTunnelBridgeDirection(t); } return AxisToTrackBits(DiagDirToAxis(GetTunnelBridgeDirection(t)));