diff options
author | frosch <frosch@openttd.org> | 2012-04-21 20:03:58 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-04-21 20:03:58 +0000 |
commit | c8ec47130d15ffc1ca4af612039ac27d7fab776c (patch) | |
tree | 45538231b2b4a3867751c7ba65546ffbe9aec16c /src | |
parent | 7dd0254b8eb4aab5278dc4c6371fe88ab36f675d (diff) | |
download | openttd-c8ec47130d15ffc1ca4af612039ac27d7fab776c.tar.xz |
(svn r24158) -Fix (r23408): Town producing no cargo at all could spawn passenger subsidies.
Diffstat (limited to 'src')
-rw-r--r-- | src/subsidy.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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; |