From 2e6c6b719fb83e831f9af130495eeed444ffe0e1 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 7 Jan 2024 19:32:42 +0000 Subject: [PATCH] Change: Link houses production on industry chain graph by TPE_PASSENGERS or TPE_MAIL cargo. --- src/industry_gui.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 672cd03c85..6810433c17 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -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); } } } @@ -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; }