changeset 14481:a6bae4e80e37 draft

(svn r19050) -Fix: Don't call callbacks for disabled industrytypes.
author frosch <frosch@openttd.org>
date Sat, 06 Feb 2010 20:41:27 +0000
parents 9f9f5e54a9d2
children e012e349cd77
files src/industry_cmd.cpp
diffstat 1 files changed, 1 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -84,12 +84,6 @@
 	_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 @@
 
 			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 */