Changeset - r19255:5913e0fedb2e
[Not reviewed]
master
0 1 0
frosch - 12 years ago 2012-04-21 20:03:58
frosch@openttd.org
(svn r24158) -Fix (r23408): Town producing no cargo at all could spawn passenger subsidies.
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/subsidy.cpp
Show inline comments
 
@@ -333,12 +333,15 @@ bool FindSubsidyTownCargoRoute()
 

	
 
	uint32 town_cargo_produced = src_town->cargo_produced;
 

	
 
	/* 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;
 
	FOR_EACH_SET_CARGO_ID(cid, town_cargo_produced) {
 
		if (cargo_number == 0) break;
 
		cargo_number--;
0 comments (0 inline, 0 general)