Index: src/tunnelbridge_cmd.cpp
===================================================================
--- src/tunnelbridge_cmd.cpp (revision 27233)
+++ src/tunnelbridge_cmd.cpp (working copy)
@@ -435,7 +435,8 @@
switch (GetTileType(tile)) {
case MP_WATER:
- if (!IsWater(tile) && !IsCoast(tile)) goto not_valid_below;
+ if (!IsWater(tile) && !IsCoast(tile) && !IsLock(tile)) goto not_valid_below;
+ if (IsLock(tile) && GetLockPart(tile) == LOCK_PART_LOWER && GetTileMaxZ(tile) + 1 > z_start) return_cmd_error(STR_ERROR_BRIDGE_TOO_LOW_FOR_TERRAIN);
break;
case MP_RAILWAY:
Index: src/water_cmd.cpp
===================================================================
--- src/water_cmd.cpp (revision 27233)
+++ src/water_cmd.cpp (working copy)
@@ -288,8 +288,9 @@
return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION);
}
- if (IsBridgeAbove(tile) || IsBridgeAbove(tile - delta) || IsBridgeAbove(tile + delta)) {
- return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
+ if (IsBridgeAbove(tile - delta)) {
+ int z_lower_bridge = GetBridgeHeight(GetNorthernBridgeEnd(tile - delta));
+ if (z_lower_bridge <= GetTileMaxZ(tile - delta) + 1) return_cmd_error(STR_ERROR_BRIDGE_TOO_LOW_FOR_TERRAIN);
}
if (flags & DC_EXEC) {
@@ -859,6 +860,7 @@
case WATER_TILE_LOCK:
DrawWaterLock(ti);
+ DrawBridgeMiddle(ti);
break;
case WATER_TILE_DEPOT: