From d6afbd025cff25c75f6cf9e1908a10c9b32a8752 Mon Sep 17 00:00:00 2001
From: alberth <alberth@openttd.org>
Date: Sat, 20 Nov 2010 12:20:59 +0000
Subject: [PATCH] (svn r21265) -Fix [FS#4245]: Don't setup target industry type
 counts if there are no industry types available.

---
 src/industry_cmd.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 7e37fd0cf9..a59c018b9e 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;