From aa546e513f6b121377fd1b6cad1b727f89b66528 Mon Sep 17 00:00:00 2001 From: yexo Date: Tue, 26 May 2009 22:03:16 +0000 Subject: (svn r16440) -Fix [NoAI]: AIRail::GetRailStationDirection returned incorrect information --- src/ai/api/ai_rail.cpp | 2 +- src/station_map.h | 7 ++++++- 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; } -- cgit v1.2.3-70-g09d2