diff options
Diffstat (limited to 'src/house.h')
-rw-r--r-- | src/house.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/house.h b/src/house.h index e6eae34c7..ed73cc806 100644 --- a/src/house.h +++ b/src/house.h @@ -137,4 +137,15 @@ struct HouseSpec { } }; +/** + * Do HouseID translation for NewGRFs. + * @param hid the HouseID to get the override for. + * @return the HouseID to actually work with. + */ +static inline HouseID GetTranslatedHouseID(HouseID hid) +{ + const HouseSpec *hs = HouseSpec::Get(hid); + return hs->override == INVALID_HOUSE_ID ? hid : hs->override; +} + #endif /* HOUSE_H */ |