summaryrefslogtreecommitdiff
path: root/src/town_map.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-12-20 14:53:32 +0000
committerrubidium <rubidium@openttd.org>2009-12-20 14:53:32 +0000
commitee3a44e74f5f24fce5f0d1a975d38453b417201b (patch)
tree756e8891ae36b21381723f9ab4b7e1ea7b1ea5a4 /src/town_map.h
parent1e1fa9ff2eee6f194e2b3172f1cf0439113f50a6 (diff)
downloadopenttd-ee3a44e74f5f24fce5f0d1a975d38453b417201b.tar.xz
(svn r18567) -Fix [FS#2613]: [NewGRF] House property 15 did not work
Diffstat (limited to 'src/town_map.h')
-rw-r--r--src/town_map.h16
1 files changed, 13 insertions, 3 deletions
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,19 +42,29 @@ 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
* @param house_id the new house type