1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-21 05:29:11 +00:00

(svn r12588) -Codechange: do not access the destination of an order directly.

This commit is contained in:
rubidium
2008-04-06 07:48:51 +00:00
parent 8cd1795fe3
commit d6623cf654
18 changed files with 116 additions and 108 deletions

View File

@@ -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;
}