summaryrefslogtreecommitdiff
path: root/station_map.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-24 08:55:08 +0000
committertron <tron@openttd.org>2006-03-24 08:55:08 +0000
commit9be713f1ae0cff0bc06bbef395fda8bf829e38c2 (patch)
tree4f245f2fb33365183177a0e7de46103b9c2464d3 /station_map.h
parent4b0e8947d5053d0987e9d9024156786acd3aec67 (diff)
downloadopenttd-9be713f1ae0cff0bc06bbef395fda8bf829e38c2.tar.xz
(svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
Diffstat (limited to 'station_map.h')
-rw-r--r--station_map.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/station_map.h b/station_map.h
new file mode 100644
index 000000000..192979d77
--- /dev/null
+++ b/station_map.h
@@ -0,0 +1,14 @@
+/* $Id$ */
+
+#include "station.h"
+
+
+static inline StationID GetStationIndex(TileIndex t)
+{
+ return (StationID)_m[t].m2;
+}
+
+static inline Station* GetStationByTile(TileIndex t)
+{
+ return GetStation(GetStationIndex(t));
+}