summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2021-02-13 17:26:55 +0000
committerCharles Pigott <charlespigott@googlemail.com>2021-02-13 18:10:13 +0000
commitd9df20d102c68cf7e2d7655b1006a868f5538d68 (patch)
treef60805b27cbd07c86ba26d50884306026d38199b
parent348f322df1274405d37fae3ae0aeeb7ba46fa90f (diff)
downloadopenttd-d9df20d102c68cf7e2d7655b1006a868f5538d68.tar.xz
Change: Use a more specific error message when attempting to bulldoze your own HQ
-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 943d89322..7a2ff2652 100644
--- a/src/object_cmd.cpp
+++ b/src/object_cmd.cpp
@@ -497,7 +497,10 @@ static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlag flags)
return_cmd_error(STR_ERROR_OWNED_BY);
} else if ((spec->flags & OBJECT_FLAG_CANNOT_REMOVE) != 0 && (spec->flags & OBJECT_FLAG_AUTOREMOVE) == 0) {
/* In the game editor or with cheats we can remove, otherwise we can't. */
- if (!_cheats.magic_bulldozer.value) return CMD_ERROR;
+ if (!_cheats.magic_bulldozer.value) {
+ if (type == OBJECT_HQ) return_cmd_error(STR_ERROR_COMPANY_HEADQUARTERS_IN);
+ return CMD_ERROR;
+ }
/* Removing with the cheat costs more in TTDPatch / the specs. */
cost.MultiplyCost(25);