From c8ec47130d15ffc1ca4af612039ac27d7fab776c Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 21 Apr 2012 20:03:58 +0000 Subject: (svn r24158) -Fix (r23408): Town producing no cargo at all could spawn passenger subsidies. --- src/subsidy.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/subsidy.cpp b/src/subsidy.cpp index 465a59560..d4a102f46 100644 --- a/src/subsidy.cpp +++ b/src/subsidy.cpp @@ -336,6 +336,9 @@ bool FindSubsidyTownCargoRoute() /* 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; -- cgit v1.2.3-70-g09d2