From e15231c4a455d0a0d0326375f659bdba67d6b33f Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 4 Jan 2009 10:50:24 +0000 Subject: [PATCH] (svn r14821) -Change [FS#2390]: make the road grids of town match, when all are using the same road layout ofcourse (cirdan) --- src/town_cmd.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index ec318f4888..218f4d9c70 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 */