summaryrefslogtreecommitdiff
path: root/src/water_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/water_cmd.cpp')
-rw-r--r--src/water_cmd.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index 335846e6f..4f8b25eac 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -641,7 +641,8 @@ static void DrawWaterTileStruct(const TileInfo *ti, const WaterDrawTileStruct *w
/** Draw a lock tile. */
static void DrawWaterLock(const TileInfo *ti)
{
- const WaterDrawTileStruct *wdts = _lock_display_seq[GetSection(ti->tile)];
+ int section = GetSection(ti->tile);
+ const WaterDrawTileStruct *wdts = _lock_display_seq[section];
/* Draw ground sprite. */
SpriteID image = wdts++->image;
@@ -669,7 +670,8 @@ static void DrawWaterLock(const TileInfo *ti)
if (base == 0) {
/* If no custom graphics, use defaults. */
base = SPR_LOCK_BASE;
- zoffs = ti->z > wdts[3].delta_y ? 24 : 0;
+ uint8 z_threshold = section >= 8 ? 8 : 0;
+ zoffs = ti->z > z_threshold ? 24 : 0;
}
DrawWaterTileStruct(ti, wdts, base, zoffs, PAL_NONE, CF_LOCKS);