mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r14821) -Change [FS#2390]: make the road grids of town match, when all are using the same road layout ofcourse (cirdan)
This commit is contained in:
parent
fad3519d4f
commit
e15231c4a4
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue