summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-02-02 19:08:34 +0000
committertruelight <truelight@openttd.org>2005-02-02 19:08:34 +0000
commit74df79331dfb23fc73426ac52ef5129586f0150b (patch)
treec1039a1abe128e1afcc2efb27f97a08cc5f143ed
parent3f45338cc9118e86012ceaa0114e5d501d807c08 (diff)
downloadopenttd-74df79331dfb23fc73426ac52ef5129586f0150b.tar.xz
(svn r1773) -Fix: [ 1114950 ] Game crashed sometimes when there were no industries
in the map
-rw-r--r--industry_cmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/industry_cmd.c b/industry_cmd.c
index 88a8d605d..865d0e02d 100644
--- a/industry_cmd.c
+++ b/industry_cmd.c
@@ -1860,7 +1860,7 @@ void IndustryMonthlyLoop(void)
/* 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);
}