summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/town_cmd.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index ec318f488..218f4d9c7 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -1580,6 +1580,15 @@ Town *CreateRandomTown(uint attempts, TownSizeMode mode, uint size)
do {
/* Generate a tile index not too close from the edge */
TileIndex tile = RandomTile();
+ switch (_settings_game.economy.town_layout) {
+ case TL_2X2_GRID:
+ tile = TileXY(TileX(tile) - TileX(tile) % 3, TileY(tile) - TileY(tile) % 3);
+ break;
+ case TL_3X3_GRID:
+ tile = TileXY(TileX(tile) & ~3, TileY(tile) & ~3);
+ break;
+ default: break;
+ }
if (DistanceFromEdge(tile) < 20) continue;
/* Make sure the tile is plain */