summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-05-26 22:03:16 +0000
committeryexo <yexo@openttd.org>2009-05-26 22:03:16 +0000
commitaa546e513f6b121377fd1b6cad1b727f89b66528 (patch)
treecb67c4d33fca4608ec0588e504a70293d1f909ff
parent0d56cfabfa6b6553f02a701d3ec3d92cc7067b63 (diff)
downloadopenttd-aa546e513f6b121377fd1b6cad1b727f89b66528.tar.xz
(svn r16440) -Fix [NoAI]: AIRail::GetRailStationDirection returned incorrect information
-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;
}