diff options
author | smatz <smatz@openttd.org> | 2008-05-14 18:31:21 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-05-14 18:31:21 +0000 |
commit | ec627dedf884069a1cbca8ebf524d761e755493c (patch) | |
tree | 865f25008dfeacaa3e7b65aadc36c6076eb1c4b0 /src/rail_map.h | |
parent | 56f15b3544089c3d690644b0b4f6e88c65710d83 (diff) | |
download | openttd-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.h | 11 |
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 |