diff options
author | frosch <frosch@openttd.org> | 2010-02-06 20:41:27 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2010-02-06 20:41:27 +0000 |
commit | 69184fdc79d58fa82a6e4baa53dfe35e0239548e (patch) | |
tree | 8f97ea035e25e96b7a64f552f97c60421df55e6b | |
parent | 0ab6f60c62c6d265074ea9a443f049882149423e (diff) | |
download | openttd-69184fdc79d58fa82a6e4baa53dfe35e0239548e.tar.xz |
(svn r19050) -Fix: Don't call callbacks for disabled industrytypes.
-rw-r--r-- | src/industry_cmd.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 33a8c09e0..4ec994fb3 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -84,12 +84,6 @@ void ResetIndustries() _industry_mngr.ResetOverride(); } -void ResetIndustryCreationProbility(IndustryType type) -{ - assert(type < INVALID_INDUSTRYTYPE); - _industry_specs[type].appear_creation[_settings_game.game_creation.landscape] = 0; -} - /** * Retrieve the type for this industry. Although it is accessed by a tile, * it will return the general type of industry, and not the sprite index @@ -1822,12 +1816,8 @@ void GenerateIndustries() ind_spc = GetIndustrySpec(it); - if (!CheckIfCallBackAllowsAvailability(it, IACT_MAPGENERATION)) { - ResetIndustryCreationProbility(it); - } - chance = ind_spc->appear_creation[_settings_game.game_creation.landscape]; - if (ind_spc->enabled && chance > 0 && ind_spc->num_table > 0) { + if (ind_spc->enabled && chance > 0 && ind_spc->num_table > 0 && CheckIfCallBackAllowsAvailability(it, IACT_MAPGENERATION)) { /* once the chance of appearance is determind, it have to be scaled by * the difficulty level. The "chance" in question is more an index into * the _numof_industry_table,in fact */ |