Index: src/economy.cpp =================================================================== --- src/economy.cpp (revision 11032) +++ src/economy.cpp (working copy) @@ -957,7 +957,7 @@ void *to; }; -static void FindSubsidyPassengerRoute(FoundRoute *fr) +static void FindSubsidyInterCityRoute(FoundRoute *fr) { Town *from,*to; @@ -967,10 +967,19 @@ if (from == NULL || from->population < 400) return; fr->to = to = GetRandomTown(); - if (from == to || to == NULL || to->population < 400 || to->pct_pass_transported > 42) + if (from == to || to == NULL || to->population < 400) return; fr->distance = DistanceManhattan(from->xy, to->xy); + + // Determine a cargo type. %50 chance for either mail or passengers. + // if the percent transported for the cargo is over 42 then cargo type + // is CT_INVALID indicating that this route is invalid. + fr->cargo = ( + CHANCE16(1,2) + ? ((from->pct_pass_transported > 42) ? CT_INVALID : CT_PASSENGERS) + : ((from->pct_mail_transported > 42) ? CT_INVALID : CT_MAIL)); + } static void FindSubsidyCargoRoute(FoundRoute *fr) @@ -1095,9 +1104,9 @@ n = 1000; do { - FindSubsidyPassengerRoute(&fr); - if (fr.distance <= 70) { - s->cargo_type = CT_PASSENGERS; + FindSubsidyInterCityRoute(&fr); + if (fr.distance <= 70 && fr.cargo != CT_INVALID) { + s->cargo_type = fr.cargo; s->from = ((Town*)fr.from)->index; s->to = ((Town*)fr.to)->index; goto add_subsidy;