diff options
author | smatz <smatz@openttd.org> | 2008-01-23 23:22:47 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-01-23 23:22:47 +0000 |
commit | 541247c830cf9b18f584e672ecdf60c5066a46d4 (patch) | |
tree | 110e7d424f3500291faff486a61f641f2ea82006 /src | |
parent | 5a7c9037709772e4678ee57d9b42f5332bd66f97 (diff) | |
download | openttd-541247c830cf9b18f584e672ecdf60c5066a46d4.tar.xz |
(svn r11969) -Codechange: documentation update, there are no 'track bits under bridge' anymore
Diffstat (limited to 'src')
-rw-r--r-- | src/elrail.cpp | 9 |
1 files 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))); |