summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-01-31 20:56:24 +0000
committerfrosch <frosch@openttd.org>2010-01-31 20:56:24 +0000
commitc23e4e45388a4802de14f4b9bcb8abec2e5926fd (patch)
tree77bc78dd07945dce53a6d94dbfe5645492af1eca /src
parent5f4f562d5333d8401157dfa0cef82e8788f21952 (diff)
downloadopenttd-c23e4e45388a4802de14f4b9bcb8abec2e5926fd.tar.xz
(svn r18976) -Fix: Estimating the cost of removing statues could clear the presence flag in the town.
Diffstat (limited to 'src')
-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) {