summaryrefslogtreecommitdiff
path: root/src/unmovable_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-08-02 22:03:28 +0000
committerrubidium <rubidium@openttd.org>2010-08-02 22:03:28 +0000
commitf2d71c1196f0fcd19b54ba9c02b59369b1853508 (patch)
tree9202f1b32a1912f8294cf277dfe14316039133f6 /src/unmovable_cmd.cpp
parent55129f1fbb6451b27ac45224dcad2cb2ed911f92 (diff)
downloadopenttd-f2d71c1196f0fcd19b54ba9c02b59369b1853508.tar.xz
(svn r20327) -Change: don't let building e.g. road remove light houses and transmitters in the scenario editor
Diffstat (limited to 'src/unmovable_cmd.cpp')
-rw-r--r--src/unmovable_cmd.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp
index c3983424e..403c00419 100644
--- a/src/unmovable_cmd.cpp
+++ b/src/unmovable_cmd.cpp
@@ -286,9 +286,15 @@ static CommandCost ClearTile_Unmovable(TileIndex tile, DoCommandFlag flags)
return DoCommand(tile, 0, 0, flags, CMD_SELL_LAND_AREA);
}
- /* checks if you're allowed to remove unmovable things */
- if (_game_mode != GM_EDITOR && _current_company != OWNER_WATER && ((flags & DC_AUTO) || !_cheats.magic_bulldozer.value)) {
- return_cmd_error((flags & DC_AUTO) ? STR_ERROR_OBJECT_IN_THE_WAY : INVALID_STRING_ID);
+ /* Water can remove everything! */
+ if (_current_company != OWNER_WATER) {
+ if (flags & DC_AUTO) {
+ /* No automatic removal by overbuilding stuff. */
+ return_cmd_error(STR_ERROR_OBJECT_IN_THE_WAY);
+ } else if (_game_mode != GM_EDITOR && !_cheats.magic_bulldozer.value) {
+ /* In the game editor or with cheats we can remove, otherwise we can't. */
+ return CMD_ERROR;
+ }
}
if (IsStatue(tile)) {