summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-11-25 16:26:50 +0000
committerrubidium <rubidium@openttd.org>2013-11-25 16:26:50 +0000
commitb53da6a6f58bf47b7d1c69de516857bad42fae67 (patch)
treebf4355818d5b13376a0747b5df24c131366eda67 /src
parentc2ee87c1a99ece79fa625623b7b3f69f265c9e88 (diff)
downloadopenttd-b53da6a6f58bf47b7d1c69de516857bad42fae67.tar.xz
(svn r26111) -Fix: theoretical case where sprite table could be overread for aqueducts that start at flat land
Diffstat (limited to 'src')
-rw-r--r--src/tunnelbridge_cmd.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index d3f584711..e33f8224e 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -1223,10 +1223,9 @@ static void DrawTile_TunnelBridge(TileInfo *ti)
/* HACK Wizardry to convert the bridge ramp direction into a sprite offset */
base_offset += (6 - tunnelbridge_direction) % 4;
- if (ti->tileh == SLOPE_FLAT) base_offset += 4; // sloped bridge head
-
/* Table number BRIDGE_PIECE_HEAD always refers to the bridge heads for any bridge type */
if (transport_type != TRANSPORT_WATER) {
+ if (ti->tileh == SLOPE_FLAT) base_offset += 4; // sloped bridge head
psid = &GetBridgeSpriteTable(GetBridgeType(ti->tile), BRIDGE_PIECE_HEAD)[base_offset];
} else {
psid = _aqueduct_sprites + base_offset;