diff options
author | celestar <celestar@openttd.org> | 2006-06-03 12:53:29 +0000 |
---|---|---|
committer | celestar <celestar@openttd.org> | 2006-06-03 12:53:29 +0000 |
commit | f84edec772485d74d45ea1a7a068e9d0990a38de (patch) | |
tree | 0a76638f03e41e5913c3963c1b25c268eaf443e1 | |
parent | e530e53564ef91787879a1b22d45dcaabf61f021 (diff) | |
download | openttd-f84edec772485d74d45ea1a7a068e9d0990a38de.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.c | 6 |
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); |