(svn r10972) -Codechange: Implement the counterpart(GetTranslatedIndustryTileID) of getindustileid of TTDPatch. This allows to ensure that the ID of a tile (taken out of the map or not) is still a valid one regarding the possible override it may have been flagged to.

It is not the strict same thing, but is what we need regarding the slightly different approach we took for newindustries.
This commit is contained in:
belugas
2007-08-24 00:23:35 +00:00
parent e9435c11b0
commit 40d4d2f2ca
3 changed files with 12 additions and 5 deletions

View File

@@ -220,6 +220,13 @@ void PlantRandomFarmField(const Industry *i);
extern IndustrySpec _industry_specs[NUM_INDUSTRYTYPES];
extern IndustryTileSpec _industry_tile_specs[NUM_INDUSTRYTILES];
static inline IndustryGfx GetTranslatedIndustryTileID(IndustryGfx gfx)
{
assert(gfx < INVALID_INDUSTRYTILE);
const IndustryTileSpec *it = &_industry_tile_specs[gfx];
return it->grf_prop.override == INVALID_INDUSTRYTILE ? gfx : it->grf_prop.override;
}
/* smallmap_gui.cpp */
void BuildIndustriesLegend();