Skip to content

Commit

Permalink
Change: Link houses production on industry chain graph by TPE_PASSENG…
Browse files Browse the repository at this point in the history
…ERS or TPE_MAIL cargo.
  • Loading branch information
PeterN committed Jan 28, 2024
1 parent d9c9567 commit 9d555f6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/industry_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2428,10 +2428,11 @@ struct CargoesRow {
if (!IsValidCargoID(cargo_fld->u.cargo.supp_cargoes[i])) ind_fld->u.industry.other_produced[i] = others[--other_count];
}
} else {
/* Houses only display what is demanded. */
/* Houses only display cargo that towns produce. */
for (uint i = 0; i < cargo_fld->u.cargo.num_cargoes; i++) {
CargoID cid = cargo_fld->u.cargo.vertical_cargoes[i];
if (cid == CT_PASSENGERS || cid == CT_MAIL) cargo_fld->ConnectCargo(cid, true);
TownProductionEffect tpe = CargoSpec::Get(cid)->town_production_effect;
if (tpe == TPE_PASSENGERS || tpe == TPE_MAIL) cargo_fld->ConnectCargo(cid, true);
}
}
}
Expand Down Expand Up @@ -2683,8 +2684,10 @@ struct IndustryCargoesWindow : public Window {
static bool HousesCanSupply(const CargoID *cargoes, uint length)
{
for (uint i = 0; i < length; i++) {
if (!IsValidCargoID(cargoes[i])) continue;
if (cargoes[i] == CT_PASSENGERS || cargoes[i] == CT_MAIL) return true;
CargoID cid = cargoes[i];
if (!IsValidCargoID(cid)) continue;
TownProductionEffect tpe = CargoSpec::Get(cid)->town_production_effect;
if (tpe == TPE_PASSENGERS || tpe == TPE_MAIL) return true;
}
return false;
}
Expand Down

0 comments on commit 9d555f6

Please sign in to comment.