summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2006-06-03 12:53:29 +0000
committercelestar <celestar@openttd.org>2006-06-03 12:53:29 +0000
commitd7261da206b81bccc5d370e79cecd5a0f9983de0 (patch)
tree0a76638f03e41e5913c3963c1b25c268eaf443e1
parent8c01bf711d86b03b4d4abc13d01200c9636be7a7 (diff)
downloadopenttd-d7261da206b81bccc5d370e79cecd5a0f9983de0.tar.xz
(svn r5083) -Fix: Assert when trying to build a lock on a tile with trees. (Thanks anboni for reporting)
-rw-r--r--water_cmd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/water_cmd.c b/water_cmd.c
index ff48573f3..a7e07e0a5 100644
--- a/water_cmd.c
+++ b/water_cmd.c
@@ -141,7 +141,11 @@ static int32 DoBuildShiplift(TileIndex tile, DiagDirection dir, uint32 flags)
return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
}
- if (IsBridgeAbove(tile) || IsBridgeAbove(tile - delta) || IsBridgeAbove(tile + delta)) return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST);
+ if ((MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) ||
+ (MayHaveBridgeAbove(tile - delta) && IsBridgeAbove(tile - delta)) ||
+ (MayHaveBridgeAbove(tile + delta) && IsBridgeAbove(tile + delta))) {
+ return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST);
+ }
if (flags & DC_EXEC) {
MakeLock(tile, dir);