(svn r18567) -Fix [FS#2613]: [NewGRF] House property 15 did not work

This commit is contained in:
rubidium
2009-12-20 14:53:32 +00:00
parent 1e1fa9ff2e
commit ee3a44e74f
4 changed files with 30 additions and 13 deletions

View File

@@ -42,16 +42,26 @@ 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 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)
{
assert(IsTileType(t, MP_HOUSE));
return _m[t].m4 | (GB(_m[t].m3, 6, 1) << 8);
return GetTranslatedHouseID(GetCleanHouseType(t));
}
/**