mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-07 06:39:08 +00:00
(svn r26308) -Fix-ish: do not try to build more towns/industries than the pool can hold (MJP)
This commit is contained in:
parent
9603014102
commit
30a95966ec
@ -1995,7 +1995,7 @@ static uint GetNumberOfIndustries()
|
||||
|
||||
assert(lengthof(numof_industry_table) == ID_END);
|
||||
uint difficulty = (_game_mode != GM_EDITOR) ? _settings_game.difficulty.industry_density : (uint)ID_VERY_LOW;
|
||||
return ScaleByMapSize(numof_industry_table[difficulty]);
|
||||
return min(IndustryPool::MAX_SIZE, ScaleByMapSize(numof_industry_table[difficulty]));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1880,6 +1880,7 @@ bool GenerateTowns(TownLayout layout)
|
||||
uint current_number = 0;
|
||||
uint difficulty = (_game_mode != GM_EDITOR) ? _settings_game.difficulty.number_towns : 0;
|
||||
uint total = (difficulty == (uint)CUSTOM_TOWN_NUMBER_DIFFICULTY) ? _settings_game.game_creation.custom_town_number : ScaleByMapSize(_num_initial_towns[difficulty] + (Random() & 7));
|
||||
total = min(TownPool::MAX_SIZE, total);
|
||||
uint32 townnameparts;
|
||||
|
||||
SetGeneratingWorldProgress(GWP_TOWN, total);
|
||||
|
Loading…
Reference in New Issue
Block a user