summaryrefslogtreecommitdiff
path: root/src/yapf
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-05-22 18:17:20 +0000
committerrubidium <rubidium@openttd.org>2009-05-22 18:17:20 +0000
commit441011b782294e93b47876f24de96a63da7dd678 (patch)
tree7592579bbde1a91f353a6d685a8a64128f6a6955 /src/yapf
parentcf0cfb908f02ca54efd5956f11909514de062015 (diff)
downloadopenttd-441011b782294e93b47876f24de96a63da7dd678.tar.xz
(svn r16382) -Codechange: make GetVehicleTrackdir a member function of Vehicle.
Diffstat (limited to 'src/yapf')
-rw-r--r--src/yapf/yapf_rail.cpp6
-rw-r--r--src/yapf/yapf_road.cpp4
-rw-r--r--src/yapf/yapf_ship.cpp2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/yapf/yapf_rail.cpp b/src/yapf/yapf_rail.cpp
index 09f672605..8d530bf52 100644
--- a/src/yapf/yapf_rail.cpp
+++ b/src/yapf/yapf_rail.cpp
@@ -540,8 +540,8 @@ bool YapfCheckReverseTrain(const Vehicle *v)
const Vehicle *last_veh = GetLastVehicleInChain(v);
/* get trackdirs of both ends */
- Trackdir td = GetVehicleTrackdir(v);
- Trackdir td_rev = ReverseTrackdir(GetVehicleTrackdir(last_veh));
+ Trackdir td = v->GetVehicleTrackdir();
+ Trackdir td_rev = ReverseTrackdir(last_veh->GetVehicleTrackdir());
/* tiles where front and back are */
TileIndex tile = v->tile;
@@ -603,7 +603,7 @@ bool YapfFindNearestRailDepotTwoWay(const Vehicle *v, int max_distance, int reve
PBSTileInfo origin = FollowTrainReservation(v);
TileIndex last_tile = last_veh->tile;
- Trackdir td_rev = ReverseTrackdir(GetVehicleTrackdir(last_veh));
+ Trackdir td_rev = ReverseTrackdir(last_veh->GetVehicleTrackdir());
typedef bool (*PfnFindNearestDepotTwoWay)(const Vehicle*, TileIndex, Trackdir, TileIndex, Trackdir, int, int, TileIndex*, bool*);
PfnFindNearestDepotTwoWay pfnFindNearestDepotTwoWay = &CYapfAnyDepotRail1::stFindNearestDepotTwoWay;
diff --git a/src/yapf/yapf_road.cpp b/src/yapf/yapf_road.cpp
index fbb7c6fa3..facfec14a 100644
--- a/src/yapf/yapf_road.cpp
+++ b/src/yapf/yapf_road.cpp
@@ -372,7 +372,7 @@ public:
{
/* set origin (tile, trackdir) */
TileIndex src_tile = v->tile;
- Trackdir src_td = GetVehicleTrackdir(v);
+ Trackdir src_td = v->GetVehicleTrackdir();
if ((TrackStatusToTrackdirBits(GetTileTrackStatus(src_tile, TRANSPORT_ROAD, v->u.road.compatible_roadtypes)) & TrackdirToTrackdirBits(src_td)) == 0) {
/* sometimes the roadveh is not on the road (it resides on non-existing track)
* how should we handle that situation? */
@@ -469,7 +469,7 @@ uint YapfRoadVehDistanceToTile(const Vehicle *v, TileIndex tile)
Depot *YapfFindNearestRoadDepot(const Vehicle *v)
{
TileIndex tile = v->tile;
- Trackdir trackdir = GetVehicleTrackdir(v);
+ Trackdir trackdir = v->GetVehicleTrackdir();
if ((TrackStatusToTrackdirBits(GetTileTrackStatus(tile, TRANSPORT_ROAD, v->u.road.compatible_roadtypes)) & TrackdirToTrackdirBits(trackdir)) == 0) {
return NULL;
}
diff --git a/src/yapf/yapf_ship.cpp b/src/yapf/yapf_ship.cpp
index 36b0b0076..0d3975833 100644
--- a/src/yapf/yapf_ship.cpp
+++ b/src/yapf/yapf_ship.cpp
@@ -54,7 +54,7 @@ public:
/* move back to the old tile/trackdir (where ship is coming from) */
TileIndex src_tile = TILE_ADD(tile, TileOffsByDiagDir(ReverseDiagDir(enterdir)));
- Trackdir trackdir = GetVehicleTrackdir(v);
+ Trackdir trackdir = v->GetVehicleTrackdir();
assert(IsValidTrackdir(trackdir));
/* convert origin trackdir to TrackdirBits */