changeset 19269:aaa50941f6b9 draft

(svn r24158) -Fix (r23408): Town producing no cargo at all could spawn passenger subsidies.
author frosch <frosch@openttd.org>
date Sat, 21 Apr 2012 20:03:58 +0000
parents 55faf473b2ef
children f498fd639d6f
files src/subsidy.cpp
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/subsidy.cpp
+++ b/src/subsidy.cpp
@@ -336,6 +336,9 @@
 	/* Passenger subsidies are not handled here. */
 	ClrBit(town_cargo_produced, CT_PASSENGERS);
 
+	/* No cargo produced at all? */
+	if (town_cargo_produced == 0) return false;
+
 	/* Choose a random cargo that is produced in the town. */
 	uint8 cargo_number = RandomRange(CountBits(town_cargo_produced));
 	CargoID cid;