summaryrefslogtreecommitdiff
path: root/src/industry_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r--src/industry_cmd.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index a56ed02b5..aff016ae6 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -1994,11 +1994,12 @@ 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 (r >= industry_probs[it]) {
r -= industry_probs[it];
it++;
+ assert(it < NUM_INDUSTRYTYPES);
}
- assert(it < NUM_INDUSTRYTYPES && industry_probs[it] > 0);
+ assert(industry_probs[it] > 0);
PlaceInitialIndustry(it, false);
}
}