summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/object_cmd.cpp5
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) {