@@ -2125,14 +2125,22 @@ static bool BuildTownHouse(Town *t, Tile
probability_max += cur_prob;
probs[num] = cur_prob;
houses[num++] = (HouseID)i;
}
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++) {
if (probs[i] > r) break;
r -= probs[i];
Status change: