diff options
author | rubidium <rubidium@openttd.org> | 2008-04-06 07:48:51 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-04-06 07:48:51 +0000 |
commit | d6623cf6541af8cb27359b59b97cb9e47f61bd0e (patch) | |
tree | bf63686bb4da660cbcdc1074a869b5b86df60166 /src/train_cmd.cpp | |
parent | 8cd1795fe32fc2afaa75f48b8b62ff992bf8f618 (diff) | |
download | openttd-d6623cf6541af8cb27359b59b97cb9e47f61bd0e.tar.xz |
(svn r12588) -Codechange: do not access the destination of an order directly.
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r-- | src/train_cmd.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index a13d88d1a..84d128e77 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -2342,7 +2342,7 @@ static bool NtpCallbFindStation(TileIndex tile, TrainTrackFollowerData *ttfd, Tr static void FillWithStationData(TrainTrackFollowerData* fd, const Vehicle* v) { fd->dest_coords = v->dest_tile; - fd->station_index = v->current_order.IsType(OT_GOTO_STATION) ? v->current_order.dest : INVALID_STATION; + fd->station_index = v->current_order.IsType(OT_GOTO_STATION) ? v->current_order.GetDestination() : INVALID_STATION; } static const byte _initial_tile_subcoord[6][4][3] = { @@ -2658,7 +2658,6 @@ static void TrainEnterStation(Vehicle *v, StationID station) } v->BeginLoading(); - v->current_order.dest = 0; } static byte AfterSetTrainPos(Vehicle *v, bool new_tile) @@ -3559,7 +3558,7 @@ static void CheckIfTrainNeedsService(Vehicle *v) const Depot* depot = GetDepotByTile(tfdd.tile); if (v->current_order.IsType(OT_GOTO_DEPOT) && - v->current_order.dest != depot->index && + v->current_order.GetDestination() != depot->index && !Chance16(3, 16)) { return; } @@ -3583,7 +3582,7 @@ void Train::OnNewDay() /* update destination */ if (this->current_order.IsType(OT_GOTO_STATION)) { - TileIndex tile = GetStation(this->current_order.dest)->train_tile; + TileIndex tile = GetStation(this->current_order.GetDestination())->train_tile; if (tile != 0) this->dest_tile = tile; } |