(svn r21969) -Feature: Introduce 'minimal' number of industries as a replacment for the old 'none' setting in the newgame window.

This commit is contained in:
alberth
2011-02-05 10:28:31 +00:00
parent 974c0f5166
commit bdf5a1c2f7
6 changed files with 16 additions and 7 deletions

View File

@@ -1895,6 +1895,7 @@ static uint GetNumberOfIndustries()
/* Number of industries on a 256x256 map. */
static const uint16 numof_industry_table[] = {
0, // none
0, // minimal
10, // very low
25, // low
55, // normal
@@ -2009,10 +2010,7 @@ void IndustryBuildData::MonthlyLoop()
*/
void GenerateIndustries()
{
uint total_amount = GetNumberOfIndustries();
/* Do not create any industries? */
if (total_amount == 0) return;
if (_settings_game.difficulty.number_industries == 0) return; // No industries.
uint32 industry_probs[NUM_INDUSTRYTYPES];
bool force_at_least_one[NUM_INDUSTRYTYPES];
@@ -2025,6 +2023,7 @@ void GenerateIndustries()
if (force_at_least_one[it]) num_forced++;
}
uint total_amount = GetNumberOfIndustries();
if (total_prob == 0 || total_amount < num_forced) {
/* Only place the forced ones */
total_amount = num_forced;