From ec627dedf884069a1cbca8ebf524d761e755493c Mon Sep 17 00:00:00 2001 From: smatz Date: Wed, 14 May 2008 18:31:21 +0000 Subject: (svn r13090) -Codechange: add functions for direct conversion from DiagDirection to Track and Trackbits --- src/rail_map.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/rail_map.h') 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 -- cgit v1.2.3-54-g00ecf