summaryrefslogtreecommitdiff
path: root/src/house.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/house.h
parent1e1fa9ff2eee6f194e2b3172f1cf0439113f50a6 (diff)
downloadopenttd-ee3a44e74f5f24fce5f0d1a975d38453b417201b.tar.xz
(svn r18567) -Fix [FS#2613]: [NewGRF] House property 15 did not work
Diffstat (limited to 'src/house.h')
-rw-r--r--src/house.h11
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 */