summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2012-04-08 17:27:47 +0000
committeralberth <alberth@openttd.org>2012-04-08 17:27:47 +0000
commita01948dbf31f377d7161400125eb62e2d3463442 (patch)
treec54b15847983775e4f9e006ab1e67744f8386daa
parentc876d183203aa658c8a591cfc0bd928276c40f6b (diff)
downloadopenttd-a01948dbf31f377d7161400125eb62e2d3463442.tar.xz
(svn r24103) -Codechange: Handle clear tiles separately from house tiles.
-rw-r--r--src/town_cmd.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 031e37a70..2dba67c20 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -2730,13 +2730,14 @@ static bool SearchTileForStatue(TileIndex tile, void *user_data)
/* Don't build statues under bridges. */
if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return false;
- if (!IsTileType(tile, MP_HOUSE) &&
- !IsTileType(tile, MP_CLEAR) &&
- !IsTileType(tile, MP_TREES)) {
- return false;
+ /* A clear-able open space is always preferred. */
+ if ((IsTileType(tile, MP_CLEAR) || IsTileType(tile, MP_TREES)) && TryClearTile(tile)) {
+ return true;
}
- return TryClearTile(tile);
+ bool house = IsTileType(tile, MP_HOUSE);
+
+ return house && TryClearTile(tile);
}
/**