Changeset - r28427:1c1166fcad99
[Not reviewed]
master
0 1 0
Peter Nelson - 11 months ago 2024-01-09 22:36:09
peter1138@openttd.org
Codechange: Use range-for when validating and finalising industries. (#11744)
1 file changed with 10 insertions and 11 deletions:
0 comments (0 inline, 0 general)
src/newgrf.cpp
Show inline comments
 
@@ -3433,8 +3433,8 @@ static bool ValidateIndustryLayout(const
 
	}
 

	
 
	bool have_regular_tile = false;
 
	for (size_t i = 0; i < size; i++) {
 
		if (layout[i].gfx != GFX_WATERTILE_SPECIALCHECK) {
 
	for (const auto &tilelayout : layout) {
 
		if (tilelayout.gfx != GFX_WATERTILE_SPECIALCHECK) {
 
			have_regular_tile = true;
 
			break;
 
		}
 
@@ -9382,15 +9382,14 @@ static void FinaliseIndustriesArray()
 
		}
 
	}
 

	
 
	for (uint j = 0; j < NUM_INDUSTRYTYPES; j++) {
 
		IndustrySpec *indsp = &_industry_specs[j];
 
		if (indsp->enabled && indsp->grf_prop.grffile != nullptr) {
 
			for (uint i = 0; i < 3; i++) {
 
				indsp->conflicting[i] = MapNewGRFIndustryType(indsp->conflicting[i], indsp->grf_prop.grffile->grfid);
 
			}
 
		}
 
		if (!indsp->enabled) {
 
			indsp->name = STR_NEWGRF_INVALID_INDUSTRYTYPE;
 
	for (auto &indsp : _industry_specs) {
 
		if (indsp.enabled && indsp.grf_prop.grffile != nullptr) {
 
			for (auto &conflicting : indsp.conflicting) {
 
				conflicting = MapNewGRFIndustryType(conflicting, indsp.grf_prop.grffile->grfid);
 
			}
 
		}
 
		if (!indsp.enabled) {
 
			indsp.name = STR_NEWGRF_INVALID_INDUSTRYTYPE;
 
		}
 
	}
 
}
0 comments (0 inline, 0 general)