summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-07-30 12:17:46 +0000
committerrubidium <rubidium@openttd.org>2011-07-30 12:17:46 +0000
commit059d43fca81b4769b8e77074d86720b20d0b4fbe (patch)
treeb8588cb227bcd995f14defba11f8cb88a32cb971
parent36e887591bde9e7358b8dc5827cb4a1e9f332006 (diff)
downloadopenttd-059d43fca81b4769b8e77074d86720b20d0b4fbe.tar.xz
(svn r22697) -Fix [FS#4694-ish]: when building a house it could be built at the wrong place if multitile houses failed some tests
-rw-r--r--src/town_cmd.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 0a4d2e14b..6c3d6a33f 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -2128,8 +2128,16 @@ static bool BuildTownHouse(Town *t, TileIndex tile)
}
uint maxz = GetTileMaxZ(tile);
+ TileIndex baseTile = tile;
while (probability_max > 0) {
+ /* Building a multitile building can change the location of tile.
+ * The building would still be built partially on that tile, but
+ * its nothern tile would be elsewere. However, if the callback
+ * fails we would be basing further work from the changed tile.
+ * So a next 1x1 tile building could be built on the wrong tile. */
+ tile = baseTile;
+
uint r = RandomRange(probability_max);
uint i;
for (i = 0; i < num; i++) {