Changeset - r13766:a1f85abe423f
[Not reviewed]
master
0 1 0
smatz - 15 years ago 2009-11-26 22:04:11
smatz@openttd.org
(svn r18302) -Fix [FS#3328](r18281): city size multiplier was ignored when generating new game
1 file changed with 6 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/town_cmd.cpp
Show inline comments
 
@@ -1402,8 +1402,9 @@ void UpdateTownMaxPass(Town *t)
 
 * @param size Parameter for size determination
 
 * @param city whether to build a city or town
 
 * @param layout the (road) layout of the town
 
 * @param manual was the town placed manually?
 
 */
 
static void DoCreateTown(Town *t, TileIndex tile, uint32 townnameparts, TownSize size, bool city, TownLayout layout)
 
static void DoCreateTown(Town *t, TileIndex tile, uint32 townnameparts, TownSize size, bool city, TownLayout layout, bool manual)
 
{
 
	t->xy = tile;
 
	t->num_houses = 0;
 
@@ -1458,7 +1459,8 @@ static void DoCreateTown(Town *t, TileIn
 

	
 
	int x = (int)size * 16 + 3;
 
	if (size == TS_RANDOM) x = (Random() & 0xF) + 8;
 
	if (city && _game_mode == GM_EDITOR) x *= _settings_game.economy.initial_city_size;
 
	/* Don't create huge cities when founding town in-game */
 
	if (city && (!manual || _game_mode == GM_EDITOR)) x *= _settings_game.economy.initial_city_size;
 

	
 
	t->num_houses += x;
 
	UpdateTownRadius(t);
 
@@ -1594,7 +1596,7 @@ CommandCost CmdFoundTown(TileIndex tile,
 
			}
 
		} else {
 
			t = new Town(tile);
 
			DoCreateTown(t, tile, townnameparts, size, city, layout);
 
			DoCreateTown(t, tile, townnameparts, size, city, layout, true);
 
		}
 
		UpdateNearestTownForRoadTiles(false);
 
		_generating_world = false;
 
@@ -1756,7 +1758,7 @@ static Town *CreateRandomTown(uint attem
 
		/* Allocate a town struct */
 
		Town *t = new Town(tile);
 

	
 
		DoCreateTown(t, tile, townnameparts, size, city, layout);
 
		DoCreateTown(t, tile, townnameparts, size, city, layout, false);
 

	
 
		/* if the population is still 0 at the point, then the
 
		 * placement is so bad it couldn't grow at all */
0 comments (0 inline, 0 general)