(svn r1773) -Fix: [ 1114950 ] Game crashed sometimes when there were no industries
authortruelight
Wed, 02 Feb 2005 19:08:34 +0000
changeset 1269 0c8818a1c07a
parent 1268 bcbbc18f5c3e
child 1270 a084b84eb971
(svn r1773) -Fix: [ 1114950 ] Game crashed sometimes when there were no industries
in the map
industry_cmd.c
--- a/industry_cmd.c	Wed Feb 02 18:28:08 2005 +0000
+++ b/industry_cmd.c	Wed Feb 02 19:08:34 2005 +0000
@@ -1860,7 +1860,7 @@
 	/* 3% chance that we start a new industry */
 	if (CHANCE16(3, 100)) {
 		MaybeNewIndustry(Random());
-	} else if (!_patches.smooth_economy) {
+	} else if (!_patches.smooth_economy && _total_industries > 0) {
 		i = GetIndustry(RandomRange(_total_industries));
 		MaybeCloseIndustry(i);
 	}