(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:
rubidium 2009-01-04 10:50:24 +00:00
parent fad3519d4f
commit e15231c4a4
1 changed files with 9 additions and 0 deletions

View File

@ -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 */