diff options
author | alberth <alberth@openttd.org> | 2012-04-08 17:27:47 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2012-04-08 17:27:47 +0000 |
commit | a01948dbf31f377d7161400125eb62e2d3463442 (patch) | |
tree | c54b15847983775e4f9e006ab1e67744f8386daa | |
parent | c876d183203aa658c8a591cfc0bd928276c40f6b (diff) | |
download | openttd-a01948dbf31f377d7161400125eb62e2d3463442.tar.xz |
(svn r24103) -Codechange: Handle clear tiles separately from house tiles.
-rw-r--r-- | src/town_cmd.cpp | 11 |
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); } /** |