diff options
author | frosch <frosch@openttd.org> | 2010-09-05 13:28:59 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2010-09-05 13:28:59 +0000 |
commit | ce1cae81ea55ff6bc45d4e2ed11d5c487ac6ba07 (patch) | |
tree | 77013d5c9a1340fca0c6c5600ad9d72c5bfacba6 | |
parent | e9cd81953ac0e9efa0149b134c75fa8ba45cbc9c (diff) | |
download | openttd-ce1cae81ea55ff6bc45d4e2ed11d5c487ac6ba07.tar.xz |
(svn r20742) -Fix: Evaluate DC_NO_WATER flag when clearing objects built on water.
-rw-r--r-- | src/object_cmd.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index 1fb55f619..f945a970f 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -365,7 +365,10 @@ static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlag flags) /* Water can remove everything! */ if (_current_company != OWNER_WATER) { - if ((spec->flags & OBJECT_FLAG_AUTOREMOVE) == 0 && flags & DC_AUTO) { + if ((flags & DC_NO_WATER) && IsTileOnWater(tile)) { + /* There is water under the object, treat it as water tile. */ + return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER); + } else if (!(spec->flags & OBJECT_FLAG_AUTOREMOVE) && (flags & DC_AUTO)) { /* No automatic removal by overbuilding stuff. */ return_cmd_error(type == OBJECT_HQ ? STR_ERROR_COMPANY_HEADQUARTERS_IN : STR_ERROR_OBJECT_IN_THE_WAY); } else if (_game_mode == GM_EDITOR) { |