diff options
author | yexo <yexo@openttd.org> | 2010-01-15 12:08:08 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-01-15 12:08:08 +0000 |
commit | d669801f1d18e295e7497eaa19d0398da67bffe8 (patch) | |
tree | 38c0215af215420346de054481c93d83f36da482 /src/ai/api/ai_order.cpp | |
parent | c37d69d161d418eaf363588df0ac67e61fd7f23e (diff) | |
download | openttd-d669801f1d18e295e7497eaa19d0398da67bffe8.tar.xz |
(svn r18807) -Codechange: introduce AirportSpec and move several non-statemachine-related variables to there
Diffstat (limited to 'src/ai/api/ai_order.cpp')
-rw-r--r-- | src/ai/api/ai_order.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ai/api/ai_order.cpp b/src/ai/api/ai_order.cpp index 1062e501a..9cde814d8 100644 --- a/src/ai/api/ai_order.cpp +++ b/src/ai/api/ai_order.cpp @@ -181,9 +181,9 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or if (v->type != VEH_AIRCRAFT) return ::Depot::Get(order->GetDestination())->xy; /* Aircraft's hangars are referenced by StationID, not DepotID */ const Station *st = ::Station::Get(order->GetDestination()); - const AirportFTAClass *airport = st->Airport(); - if (airport == NULL || airport->nof_depots == 0) return INVALID_TILE; - return st->airport_tile + ::ToTileIndexDiff(st->Airport()->airport_depots[0]); + const AirportSpec *as = st->GetAirportSpec(); + if (as == NULL || as->nof_depots == 0) return INVALID_TILE; + return st->airport_tile + ::ToTileIndexDiff(as->depot_table[0]); } case OT_GOTO_STATION: { @@ -200,8 +200,8 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or } else if (st->truck_stops != NULL) { return st->truck_stops->xy; } else if (st->airport_tile != INVALID_TILE) { - const AirportFTAClass *fta = st->Airport(); - TILE_LOOP(tile, fta->size_x, fta->size_y, st->airport_tile) { + const AirportSpec *as = st->GetAirportSpec(); + TILE_LOOP(tile, as->size_x, as->size_y, st->airport_tile) { if (!::IsHangar(tile)) return tile; } } |