From f84edec772485d74d45ea1a7a068e9d0990a38de Mon Sep 17 00:00:00 2001 From: celestar Date: Sat, 3 Jun 2006 12:53:29 +0000 Subject: (svn r5083) -Fix: Assert when trying to build a lock on a tile with trees. (Thanks anboni for reporting) --- water_cmd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3-70-g09d2