diff options
author | rubidium <rubidium@openttd.org> | 2009-01-04 10:50:24 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-01-04 10:50:24 +0000 |
commit | e15231c4a455d0a0d0326375f659bdba67d6b33f (patch) | |
tree | 57d992bf69ea4fef59d9e70fdd973e1172be20f8 /src | |
parent | fad3519d4f8e0c43d66bfb6031217c47367a5cac (diff) | |
download | openttd-e15231c4a455d0a0d0326375f659bdba67d6b33f.tar.xz |
(svn r14821) -Change [FS#2390]: make the road grids of town match, when all are using the same road layout ofcourse (cirdan)
Diffstat (limited to 'src')
-rw-r--r-- | src/town_cmd.cpp | 9 |
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 */ |