Changeset - r26830:0e341a74153a
[Not reviewed]
master
0 1 0
Rubidium - 22 months ago 2023-01-29 15:48:00
rubidium@openttd.org
Fix #10430, Fix 6ba55e6: display chain window causing assert
1 file changed with 14 insertions and 14 deletions:
0 comments (0 inline, 0 general)
src/industry_gui.cpp
Show inline comments
 
@@ -2760,12 +2760,12 @@ struct IndustryCargoesWindow : public Wi
 
		_displayed_industries.set(displayed_it);
 

	
 
		this->fields.clear();
 
		CargoesRow &row = this->fields.emplace_back();
 
		row.columns[0].MakeHeader(STR_INDUSTRY_CARGOES_PRODUCERS);
 
		row.columns[1].MakeEmpty(CFT_SMALL_EMPTY);
 
		row.columns[2].MakeEmpty(CFT_SMALL_EMPTY);
 
		row.columns[3].MakeEmpty(CFT_SMALL_EMPTY);
 
		row.columns[4].MakeHeader(STR_INDUSTRY_CARGOES_CUSTOMERS);
 
		CargoesRow &first_row = this->fields.emplace_back();
 
		first_row.columns[0].MakeHeader(STR_INDUSTRY_CARGOES_PRODUCERS);
 
		first_row.columns[1].MakeEmpty(CFT_SMALL_EMPTY);
 
		first_row.columns[2].MakeEmpty(CFT_SMALL_EMPTY);
 
		first_row.columns[3].MakeEmpty(CFT_SMALL_EMPTY);
 
		first_row.columns[4].MakeHeader(STR_INDUSTRY_CARGOES_CUSTOMERS);
 

	
 
		const IndustrySpec *central_sp = GetIndustrySpec(displayed_it);
 
		bool houses_supply = HousesCanSupply(central_sp->accepts_cargo, lengthof(central_sp->accepts_cargo));
 
@@ -2775,7 +2775,7 @@ struct IndustryCargoesWindow : public Wi
 
		int num_cust = CountMatchingAcceptingIndustries(central_sp->produced_cargo, lengthof(central_sp->produced_cargo)) + houses_accept;
 
		int num_indrows = std::max(3, std::max(num_supp, num_cust)); // One is needed for the 'it' industry, and 2 for the cargo labels.
 
		for (int i = 0; i < num_indrows; i++) {
 
			row = this->fields.emplace_back();
 
			CargoesRow &row = this->fields.emplace_back();
 
			row.columns[0].MakeEmpty(CFT_EMPTY);
 
			row.columns[1].MakeCargo(central_sp->accepts_cargo, lengthof(central_sp->accepts_cargo));
 
			row.columns[2].MakeEmpty(CFT_EMPTY);
 
@@ -2837,12 +2837,12 @@ struct IndustryCargoesWindow : public Wi
 
		_displayed_industries.reset();
 

	
 
		this->fields.clear();
 
		CargoesRow &row = this->fields.emplace_back();
 
		row.columns[0].MakeHeader(STR_INDUSTRY_CARGOES_PRODUCERS);
 
		row.columns[1].MakeEmpty(CFT_SMALL_EMPTY);
 
		row.columns[2].MakeHeader(STR_INDUSTRY_CARGOES_CUSTOMERS);
 
		row.columns[3].MakeEmpty(CFT_SMALL_EMPTY);
 
		row.columns[4].MakeEmpty(CFT_SMALL_EMPTY);
 
		CargoesRow &first_row = this->fields.emplace_back();
 
		first_row.columns[0].MakeHeader(STR_INDUSTRY_CARGOES_PRODUCERS);
 
		first_row.columns[1].MakeEmpty(CFT_SMALL_EMPTY);
 
		first_row.columns[2].MakeHeader(STR_INDUSTRY_CARGOES_CUSTOMERS);
 
		first_row.columns[3].MakeEmpty(CFT_SMALL_EMPTY);
 
		first_row.columns[4].MakeEmpty(CFT_SMALL_EMPTY);
 

	
 
		bool houses_supply = HousesCanSupply(&cid, 1);
 
		bool houses_accept = HousesCanAccept(&cid, 1);
 
@@ -2850,7 +2850,7 @@ struct IndustryCargoesWindow : public Wi
 
		int num_cust = CountMatchingAcceptingIndustries(&cid, 1) + houses_accept;
 
		int num_indrows = std::max(num_supp, num_cust);
 
		for (int i = 0; i < num_indrows; i++) {
 
			row = this->fields.emplace_back();
 
			CargoesRow &row = this->fields.emplace_back();
 
			row.columns[0].MakeEmpty(CFT_EMPTY);
 
			row.columns[1].MakeCargo(&cid, 1);
 
			row.columns[2].MakeEmpty(CFT_EMPTY);
0 comments (0 inline, 0 general)