diff options
author | smatz <smatz@openttd.org> | 2008-04-23 19:47:23 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-04-23 19:47:23 +0000 |
commit | 459259aeec83dbc11c2647788d82ab5d949038cf (patch) | |
tree | 6fa1915d48d50bfa1dae69dd8c4e8f57eba77ed1 /src/elrail.cpp | |
parent | ccfe024a2a2218af6824b7d82181c063b9c8eeee (diff) | |
download | openttd-459259aeec83dbc11c2647788d82ab5d949038cf.tar.xz |
(svn r12853) -Fix: catenary on tunnel entrances and middle bridge pieces was drawn twice in some cases
Diffstat (limited to 'src/elrail.cpp')
-rw-r--r-- | src/elrail.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/elrail.cpp b/src/elrail.cpp index 3637f0ba5..a043863b6 100644 --- a/src/elrail.cpp +++ b/src/elrail.cpp @@ -377,8 +377,13 @@ static void DrawCatenaryRailway(const TileInfo *ti) } } -static void DrawCatenaryOnBridge(const TileInfo *ti) +void DrawCatenaryOnBridge(const TileInfo *ti) { + if (_patches.disable_elrails) return; + + /* Do not draw catenary if it is invisible */ + if (IsInvisibilitySet(TO_CATENARY)) return; + TileIndex end = GetSouthernBridgeEnd(ti->tile); TileIndex start = GetOtherBridgeEnd(end); @@ -437,14 +442,6 @@ void DrawCatenary(const TileInfo *ti) /* Do not draw catenary if it is invisible */ if (IsInvisibilitySet(TO_CATENARY)) return; - if (MayHaveBridgeAbove(ti->tile) && IsBridgeAbove(ti->tile)) { - TileIndex head = GetNorthernBridgeEnd(ti->tile); - - if (GetTunnelBridgeTransportType(head) == TRANSPORT_RAIL && HasCatenary(GetRailType(head))) { - DrawCatenaryOnBridge(ti); - } - } - switch (GetTileType(ti->tile)) { case MP_RAILWAY: if (IsRailDepot(ti->tile)) { |