From 860a538adc56a678f640f606692ea7ca00c8d424 Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 10 Sep 2009 14:37:55 +0000 Subject: (svn r17495) -Codechange: replace 'Depot::Get(GetDepotIndex(tile))->index' with GetDepotIndex(tile) --- src/train_cmd.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/train_cmd.cpp') diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 80a88ef48..bdbe2d2e4 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -2264,7 +2264,7 @@ bool Train::FindClosestDepot(TileIndex *location, DestinationID *destination, bo if (tfdd.best_length == UINT_MAX) return false; if (location != NULL) *location = tfdd.tile; - if (destination != NULL) *destination = Depot::GetByTile(tfdd.tile)->index; + if (destination != NULL) *destination = GetDepotIndex(tfdd.tile); if (reverse != NULL) *reverse = tfdd.reverse; return true; @@ -4526,15 +4526,15 @@ static void CheckIfTrainNeedsService(Train *v) return; } - const Depot *depot = Depot::GetByTile(tfdd.tile); + DepotID depot = GetDepotIndex(tfdd.tile); if (v->current_order.IsType(OT_GOTO_DEPOT) && - v->current_order.GetDestination() != depot->index && + v->current_order.GetDestination() != depot && !Chance16(3, 16)) { return; } - v->current_order.MakeGoToDepot(depot->index, ODTFB_SERVICE); + v->current_order.MakeGoToDepot(depot, ODTFB_SERVICE); v->dest_tile = tfdd.tile; InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH); } -- cgit v1.2.3-54-g00ecf