summaryrefslogtreecommitdiff
path: root/src/rail_map.h
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-05-14 18:31:21 +0000
committersmatz <smatz@openttd.org>2008-05-14 18:31:21 +0000
commitec627dedf884069a1cbca8ebf524d761e755493c (patch)
tree865f25008dfeacaa3e7b65aadc36c6076eb1c4b0 /src/rail_map.h
parent56f15b3544089c3d690644b0b4f6e88c65710d83 (diff)
downloadopenttd-ec627dedf884069a1cbca8ebf524d761e755493c.tar.xz
(svn r13090) -Codechange: add functions for direct conversion from DiagDirection to Track and Trackbits
Diffstat (limited to 'src/rail_map.h')
-rw-r--r--src/rail_map.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/rail_map.h b/src/rail_map.h
index 2789b419a..8c436d055 100644
--- a/src/rail_map.h
+++ b/src/rail_map.h
@@ -168,6 +168,17 @@ static inline DiagDirection GetRailDepotDirection(TileIndex t)
return (DiagDirection)GB(_m[t].m5, 0, 2);
}
+/**
+ * Returns the track of a depot, ignoring direction
+ * @pre IsRailDepotTile(t)
+ * @param t the tile to get the depot track from
+ * @return the track of the depot
+ */
+static inline Track GetRailDepotTrack(TileIndex t)
+{
+ return DiagDirToDiagTrack(GetRailDepotDirection(t));
+}
+
/**
* Returns the axis of the waypoint