# HG changeset patch # User rubidium # Date 1194132852 0 # Node ID 7445cb71f080bf0c18bf81094cdde1dfb43137ad # Parent dc5f1aa98fe97320345b2b9d4bdf22f5d8251448 (svn r11373) -Fix [FS#1398]: do not even think about building disabled industries. diff -r dc5f1aa98fe9 -r 7445cb71f080 src/industry_cmd.cpp --- a/src/industry_cmd.cpp Sat Nov 03 15:32:07 2007 +0000 +++ b/src/industry_cmd.cpp Sat Nov 03 23:34:12 2007 +0000 @@ -1784,11 +1784,14 @@ /* 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;