From ee3a44e74f5f24fce5f0d1a975d38453b417201b Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 20 Dec 2009 14:53:32 +0000 Subject: (svn r18567) -Fix [FS#2613]: [NewGRF] House property 15 did not work --- src/town_map.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/town_map.h') diff --git a/src/town_map.h b/src/town_map.h index 2fd38b210..148fb2891 100644 --- a/src/town_map.h +++ b/src/town_map.h @@ -42,18 +42,28 @@ static inline void SetTownIndex(TileIndex t, TownID index) /** * Get the type of this house, which is an index into the house spec array - * Since m4 is only a byte and we want to support 512 houses, we use the bit 6 - * of m3 as an additional bit to house type. + * without doing any NewGRF related translations. * @param t the tile * @pre IsTileType(t, MP_HOUSE) * @return house type */ -static inline HouseID GetHouseType(TileIndex t) +static inline HouseID GetCleanHouseType(TileIndex t) { assert(IsTileType(t, MP_HOUSE)); return _m[t].m4 | (GB(_m[t].m3, 6, 1) << 8); } +/** + * Get the type of this house, which is an index into the house spec array + * @param t the tile + * @pre IsTileType(t, MP_HOUSE) + * @return house type + */ +static inline HouseID GetHouseType(TileIndex t) +{ + return GetTranslatedHouseID(GetCleanHouseType(t)); +} + /** * Set the house type. * @param t the tile -- cgit v1.2.3-54-g00ecf