industry_cmd.c
changeset 4354 684ab9249dae
parent 4346 3f00094f2670
child 4356 bc52a48e2590
--- a/industry_cmd.c	Tue Aug 22 20:39:18 2006 +0000
+++ b/industry_cmd.c	Tue Aug 22 20:41:26 2006 +0000
@@ -1878,8 +1878,8 @@
 	/* 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);
 	}