summaryrefslogtreecommitdiff
path: root/industry_map.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-24 08:00:45 +0000
committertron <tron@openttd.org>2006-03-24 08:00:45 +0000
commit4b0e8947d5053d0987e9d9024156786acd3aec67 (patch)
tree4204c22d52637b86f21c6792b4e8b1b842f5ed7e /industry_map.h
parent742e806d737335cb62a2d471addf19fcbe220f49 (diff)
downloadopenttd-4b0e8947d5053d0987e9d9024156786acd3aec67.tar.xz
(svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
Diffstat (limited to 'industry_map.h')
-rw-r--r--industry_map.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/industry_map.h b/industry_map.h
new file mode 100644
index 000000000..c3a8d0b1c
--- /dev/null
+++ b/industry_map.h
@@ -0,0 +1,16 @@
+/* $Id$ */
+
+#include "industry.h"
+#include "macros.h"
+#include "tile.h"
+
+
+static inline uint GetIndustryIndex(TileIndex t)
+{
+ return _m[t].m2;
+}
+
+static inline Industry* GetIndustryByTile(TileIndex t)
+{
+ return GetIndustry(GetIndustryIndex(t));
+}