From c22723c643919acd29fb566a167da7383b5d3d3e Mon Sep 17 00:00:00 2001 From: smatz Date: Wed, 23 Jan 2008 23:22:47 +0000 Subject: (svn r11969) -Codechange: documentation update, there are no 'track bits under bridge' anymore --- src/elrail.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/elrail.cpp b/src/elrail.cpp index 0e429e04e..d2a6fcba9 100644 --- a/src/elrail.cpp +++ b/src/elrail.cpp @@ -74,8 +74,11 @@ static inline TLG GetTLG(TileIndex t) 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 @@ static TrackBits GetRailTrackBitsUniversal(TileIndex t, byte *override) 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))); -- cgit v1.2.3-70-g09d2