summaryrefslogtreecommitdiff
path: root/src/elrail.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-09-11 19:44:30 +0000
committerfrosch <frosch@openttd.org>2008-09-11 19:44:30 +0000
commit80b0671cc9dbb477cbba83f75818ee3f2616af77 (patch)
treeacde92f23a14dd924ec5d3dc848159f191a4bace /src/elrail.cpp
parent33c2b798fb2a077a716a213be5355a09f7c15ade (diff)
downloadopenttd-80b0671cc9dbb477cbba83f75818ee3f2616af77.tar.xz
(svn r14292) -Cleanup (r11128): Move an 'if' out of a loop as it does not need to be iterated. (spotted by smatz)
Diffstat (limited to 'src/elrail.cpp')
-rw-r--r--src/elrail.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/elrail.cpp b/src/elrail.cpp
index e4fbbec59..7558c9ded 100644
--- a/src/elrail.cpp
+++ b/src/elrail.cpp
@@ -346,6 +346,9 @@ static void DrawCatenaryRailway(const TileInfo *ti)
}
}
+ /* The wire above the tunnel is drawn together with the tunnel-roof (see DrawCatenaryOnTunnel()) */
+ if (IsTunnelTile(ti->tile)) return;
+
/* Don't draw a wire under a low bridge */
if (MayHaveBridgeAbove(ti->tile) && IsBridgeAbove(ti->tile) && !IsTransparencySet(TO_CATENARY)) {
uint height = GetBridgeHeight(GetNorthernBridgeEnd(ti->tile));
@@ -356,7 +359,6 @@ static void DrawCatenaryRailway(const TileInfo *ti)
/* Drawing of pylons is finished, now draw the wires */
for (Track t = TRACK_BEGIN; t < TRACK_END; t++) {
if (HasBit(trackconfig[TS_HOME], t)) {
- if (IsTunnelTile(ti->tile)) break; // drawn together with tunnel-roof (see DrawCatenaryOnTunnel())
byte PCPconfig = HasBit(PCPstatus, PCPpositions[t][0]) +
(HasBit(PCPstatus, PCPpositions[t][1]) << 1);