diff options
author | frosch <frosch@openttd.org> | 2009-07-20 19:58:33 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-07-20 19:58:33 +0000 |
commit | d5a4c893656f61950595c057c7643f4082228d47 (patch) | |
tree | ae65d69eb2c0ef06cd95925420d1e3fb1c11c382 /src/yapf | |
parent | e3752f3ef82278a34fe5cce5515e240589465c77 (diff) | |
download | openttd-d5a4c893656f61950595c057c7643f4082228d47.tar.xz |
(svn r16894) -Codechange: Add [Specialised]Vehicle::Last().
Diffstat (limited to 'src/yapf')
-rw-r--r-- | src/yapf/yapf_rail.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/yapf/yapf_rail.cpp b/src/yapf/yapf_rail.cpp index 13c064eb8..d5a5f51a2 100644 --- a/src/yapf/yapf_rail.cpp +++ b/src/yapf/yapf_rail.cpp @@ -537,8 +537,7 @@ Trackdir YapfChooseRailTrack(const Vehicle *v, TileIndex tile, DiagDirection ent bool YapfCheckReverseTrain(const Vehicle *vt) { const Train *v = Train::From(vt); - /* last wagon */ - const Train *last_veh = Train::From(GetLastVehicleInChain(v)); + const Train *last_veh = v->Last(); /* get trackdirs of both ends */ Trackdir td = v->GetVehicleTrackdir(); @@ -600,7 +599,7 @@ bool YapfFindNearestRailDepotTwoWay(const Vehicle *v, int max_distance, int reve *depot_tile = INVALID_TILE; *reversed = false; - const Vehicle *last_veh = GetLastVehicleInChain(v); + const Vehicle *last_veh = v->Last(); PBSTileInfo origin = FollowTrainReservation(Train::From(v)); TileIndex last_tile = last_veh->tile; |