summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/subsidy.cpp3
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;