Fix #13299: Merge IT_INVALID and INVALID_INDUSTRYTYPE (#13300)

* Fix #13299: Merge IT_INVALID and INVALID_INDUSTRYTYPE

* Codefix: Use NUM_INDUSTRYTILES where it's intended
This commit is contained in:
Loïc Guilloux
2025-01-10 01:17:11 +01:00
committed by GitHub
parent c0edbe0d37
commit 46f181c8a6
10 changed files with 32 additions and 34 deletions

View File

@@ -194,7 +194,7 @@ inline IndustryGfx GetTranslatedIndustryTileID(IndustryGfx gfx)
* will never be assigned as a tile index and is only required in order to do some
* tests while building the industry (as in WATER REQUIRED */
if (gfx != 0xFF) {
assert(gfx < INVALID_INDUSTRYTILE);
assert(gfx < NUM_INDUSTRYTILES);
const IndustryTileSpec *it = &_industry_tile_specs[gfx];
return it->grf_prop.override == INVALID_INDUSTRYTILE ? gfx : it->grf_prop.override;
} else {
@@ -202,6 +202,4 @@ inline IndustryGfx GetTranslatedIndustryTileID(IndustryGfx gfx)
}
}
static const uint8_t IT_INVALID = 255;
#endif /* INDUSTRYTYPE_H */