# HG changeset patch # User frosch # Date 2012-04-21 20:03:58 # Node ID 5913e0fedb2e95a2bec6f66eebabfd234272b6e7 # Parent 76c046cc28aef78ad28f880e12d1a51078c623c2 (svn r24158) -Fix (r23408): Town producing no cargo at all could spawn passenger subsidies. diff --git a/src/subsidy.cpp b/src/subsidy.cpp --- 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;