summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ai/api/ai_rail.cpp2
-rw-r--r--src/station_map.h7
2 files changed, 7 insertions, 2 deletions
diff --git a/src/ai/api/ai_rail.cpp b/src/ai/api/ai_rail.cpp
index 6914f99c1..72905ff5b 100644
--- a/src/ai/api/ai_rail.cpp
+++ b/src/ai/api/ai_rail.cpp
@@ -110,7 +110,7 @@
{
if (!IsRailStationTile(tile)) return RAILTRACK_INVALID;
- return (RailTrack)::GetRailStationTrack(tile);
+ return (RailTrack)::GetRailStationTrackBits(tile);
}
/* static */ bool AIRail::BuildRailDepot(TileIndex tile, TileIndex front)
diff --git a/src/station_map.h b/src/station_map.h
index 06da1588f..04b17c235 100644
--- a/src/station_map.h
+++ b/src/station_map.h
@@ -202,6 +202,11 @@ static inline Track GetRailStationTrack(TileIndex t)
return AxisToTrack(GetRailStationAxis(t));
}
+static inline TrackBits GetRailStationTrackBits(TileIndex t)
+{
+ return AxisToTrackBits(GetRailStationAxis(t));
+}
+
static inline bool IsCompatibleTrainStationTile(TileIndex t1, TileIndex t2)
{
assert(IsRailwayStationTile(t2));
@@ -245,7 +250,7 @@ static inline void SetRailwayStationReservation(TileIndex t, bool b)
*/
static inline TrackBits GetRailStationReservation(TileIndex t)
{
- return GetRailwayStationReservation(t) ? AxisToTrackBits(GetRailStationAxis(t)) : TRACK_BIT_NONE;
+ return GetRailwayStationReservation(t) ? GetRailStationTrackBits(t) : TRACK_BIT_NONE;
}