summaryrefslogtreecommitdiff
path: root/src/industry.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/industry.h')
-rw-r--r--src/industry.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/industry.h b/src/industry.h
index 2cdf1ce7e..c19dd83ae 100644
--- a/src/industry.h
+++ b/src/industry.h
@@ -222,9 +222,18 @@ 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;
+ /* the 0xFF should be GFX_WATERTILE_SPECIALCHECK but for reasons of include mess,
+ * we'll simplify the writing.
+ * Basically, the first test is required since the GFX_WATERTILE_SPECIALCHECK value
+ * 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);
+ const IndustryTileSpec *it = &_industry_tile_specs[gfx];
+ return it->grf_prop.override == INVALID_INDUSTRYTILE ? gfx : it->grf_prop.override;
+ } else {
+ return gfx;
+ }
}
/* smallmap_gui.cpp */