summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-02-02 19:15:35 +0000
committertruelight <truelight@openttd.org>2005-02-02 19:15:35 +0000
commit08e3e9cead669409b9c7e993f036ba270127de48 (patch)
tree98134d4cbca817badd3a3453fd074c3cb86247f7
parent42c3de1459d9800f9402f8c637aa48b2ae884ee1 (diff)
downloadopenttd-08e3e9cead669409b9c7e993f036ba270127de48.tar.xz
(svn r1774) -Fix: fixed an other possible crash related to previous commit
-rw-r--r--industry_cmd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/industry_cmd.c b/industry_cmd.c
index 865d0e02d..1e1c5e7f5 100644
--- a/industry_cmd.c
+++ b/industry_cmd.c
@@ -1862,7 +1862,8 @@ void IndustryMonthlyLoop(void)
MaybeNewIndustry(Random());
} else if (!_patches.smooth_economy && _total_industries > 0) {
i = GetIndustry(RandomRange(_total_industries));
- MaybeCloseIndustry(i);
+ if (i->xy != 0)
+ MaybeCloseIndustry(i);
}
_current_player = old_player;