summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-01-23 23:22:47 +0000
committersmatz <smatz@openttd.org>2008-01-23 23:22:47 +0000
commitc22723c643919acd29fb566a167da7383b5d3d3e (patch)
tree110e7d424f3500291faff486a61f641f2ea82006
parent74af65e556f6cedf4de72737fb27831f603953c4 (diff)
downloadopenttd-c22723c643919acd29fb566a167da7383b5d3d3e.tar.xz
(svn r11969) -Codechange: documentation update, there are no 'track bits under bridge' anymore
-rw-r--r--src/elrail.cpp9
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)));