summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-11-20 12:20:59 +0000
committeralberth <alberth@openttd.org>2010-11-20 12:20:59 +0000
commitd6afbd025cff25c75f6cf9e1908a10c9b32a8752 (patch)
treed2b262957aa33b07b34adf4fabbc53972f8648b3 /src
parent130e2e9f4f51491b43b1d5107489b6de8ed903b4 (diff)
downloadopenttd-d6afbd025cff25c75f6cf9e1908a10c9b32a8752.tar.xz
(svn r21265) -Fix [FS#4245]: Don't setup target industry type counts if there are no industry types available.
Diffstat (limited to 'src')
-rw-r--r--src/industry_cmd.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 7e37fd0cf..a59c018b9 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -2137,6 +2137,8 @@ void IndustryBuildData::SetupTargetCount()
total_prob += ibd->probability;
}
+ if (total_prob == 0) return; // No buildable industries.
+
/* Subtract forced industries from the number of industries available for construction. */
total_amount = (total_amount <= force_build) ? 0 : total_amount - force_build;