# HG changeset patch # User frosch # Date 2010-02-20 16:17:45 # Node ID 95adc72db8308d0ea09b7a572af22729de39b980 # Parent 5b7b7b861d6e5036143f1aacac8f1863749559cf (svn r19167) -Fix [FS#3631](r19120): Industry 0 could be choosen even if not available. diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -1903,7 +1903,7 @@ void GenerateIndustries() for (uint i = 0; i < total_amount; i++) { uint32 r = RandomRange(total_prob); IndustryType it = 0; - while (it < NUM_INDUSTRYTYPES && r > industry_probs[it]) { + while (it < NUM_INDUSTRYTYPES && r >= industry_probs[it]) { r -= industry_probs[it]; it++; }