summaryrefslogtreecommitdiff
path: root/industry_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'industry_cmd.c')
-rw-r--r--industry_cmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/industry_cmd.c b/industry_cmd.c
index 454c2b9b1..b36f01ff5 100644
--- a/industry_cmd.c
+++ b/industry_cmd.c
@@ -1878,8 +1878,8 @@ void IndustryMonthlyLoop(void)
/* 3% chance that we start a new industry */
if (CHANCE16(3, 100)) {
MaybeNewIndustry(Random());
- } else if (!_patches.smooth_economy && _total_industries > 0) {
- i = GetIndustry(RandomRange(_total_industries));
+ } else if (!_patches.smooth_economy && GetIndustryArraySize() > 0) {
+ i = GetIndustry(RandomRange(GetIndustryArraySize()));
if (IsValidIndustry(i)) ChangeIndustryProduction(i);
}