diff options
author | alberth <alberth@openttd.org> | 2011-02-05 10:28:31 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2011-02-05 10:28:31 +0000 |
commit | bdf5a1c2f7077323c26e1c99a22dcc80a7b50245 (patch) | |
tree | 374e89336ea4abf7bbe1eadf0ca3409287722536 /src/industry_cmd.cpp | |
parent | 974c0f51662ec15012408cc675437575d946710b (diff) | |
download | openttd-bdf5a1c2f7077323c26e1c99a22dcc80a7b50245.tar.xz |
(svn r21969) -Feature: Introduce 'minimal' number of industries as a replacment for the old 'none' setting in the newgame window.
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r-- | src/industry_cmd.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 84e35181b..b5dbf2efe 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -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; |