summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-11-03 23:34:12 +0000
committerrubidium <rubidium@openttd.org>2007-11-03 23:34:12 +0000
commitc871dc1dd51634f6ac49c803be8389088ee39d43 (patch)
tree07ac5fa3445be2152706d2cbb44d51a48e13b088 /src
parent073290021b1b430909a259f1545d074232251840 (diff)
downloadopenttd-c871dc1dd51634f6ac49c803be8389088ee39d43.tar.xz
(svn r11373) -Fix [FS#1398]: do not even think about building disabled industries.
Diffstat (limited to 'src')
-rw-r--r--src/industry_cmd.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index f3bf356aa..4e846cec5 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -1784,11 +1784,14 @@ static void MaybeNewIndustry(void)
/* Generate a list of all possible industries that can be built. */
for (j = 0; j < NUM_INDUSTRYTYPES; j++) {
- byte chance = GetIndustrySpec(j)->appear_ingame[_opt.landscape];
+ ind_spc = GetIndustrySpec(j);
+ byte chance = ind_spc->appear_ingame[_opt.landscape];
+
+ if (!ind_spc->enabled || chance == 0) continue;
/* If there is no Callback CBID_INDUSTRY_AVAILABLE or if this one did anot failed,
* and if appearing chance for this landscape is above 0, this industry can be chosen */
- if (CheckIfCallBackAllowsAvailability(j, IACT_RANDOMCREATION) && chance != 0) {
+ if (CheckIfCallBackAllowsAvailability(j, IACT_RANDOMCREATION)) {
probability_max += chance;
/* adds the result for this industry */
cumulative_probs[num].ind = j;