Feature: Set a custom number of industries in map generation window (#10340)
This commit is contained in:
@@ -2236,10 +2236,14 @@ static uint GetNumberOfIndustries()
|
||||
25, // low
|
||||
55, // normal
|
||||
80, // high
|
||||
0, // custom
|
||||
};
|
||||
|
||||
assert(lengthof(numof_industry_table) == ID_END);
|
||||
uint difficulty = (_game_mode != GM_EDITOR) ? _settings_game.difficulty.industry_density : (uint)ID_VERY_LOW;
|
||||
|
||||
if (difficulty == ID_CUSTOM) return std::min<uint>(IndustryPool::MAX_SIZE, _settings_game.game_creation.custom_industry_number);
|
||||
|
||||
return std::min<uint>(IndustryPool::MAX_SIZE, ScaleByMapSize(numof_industry_table[difficulty]));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user