summaryrefslogtreecommitdiff
path: root/src/unmovable_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/unmovable_cmd.cpp')
-rw-r--r--src/unmovable_cmd.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp
index 91715604b..8e412b16f 100644
--- a/src/unmovable_cmd.cpp
+++ b/src/unmovable_cmd.cpp
@@ -287,9 +287,11 @@ static CommandCost ClearTile_Unmovable(TileIndex tile, DoCommandFlag flags)
if (IsStatue(tile)) {
if (flags & DC_AUTO) return_cmd_error(STR_ERROR_OBJECT_IN_THE_WAY);
- TownID town = GetStatueTownID(tile);
- ClrBit(Town::Get(town)->statues, GetTileOwner(tile));
- SetWindowDirty(WC_TOWN_AUTHORITY, town);
+ if (flags & DC_EXEC) {
+ TownID town = GetStatueTownID(tile);
+ ClrBit(Town::Get(town)->statues, GetTileOwner(tile));
+ SetWindowDirty(WC_TOWN_AUTHORITY, town);
+ }
}
if (flags & DC_EXEC) {