summaryrefslogtreecommitdiff
path: root/src/ai/api
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-02-22 14:17:07 +0000
committeryexo <yexo@openttd.org>2010-02-22 14:17:07 +0000
commit698737f485cfbdd1605faecd50395bb67f7dac75 (patch)
treeb79303520896365e70a9aa3224a5f1c6a14b5aba /src/ai/api
parent7ca4c31cf558ff29b3cbe14cd348bcf649445dfc (diff)
downloadopenttd-698737f485cfbdd1605faecd50395bb67f7dac75.tar.xz
(svn r19198) -Codechange: store the size of stations in savegames
Diffstat (limited to 'src/ai/api')
-rw-r--r--src/ai/api/ai_order.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ai/api/ai_order.cpp b/src/ai/api/ai_order.cpp
index cdc56ccf8..71b111f8a 100644
--- a/src/ai/api/ai_order.cpp
+++ b/src/ai/api/ai_order.cpp
@@ -197,10 +197,9 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
return st->bus_stops->xy;
} else if (st->truck_stops != NULL) {
return st->truck_stops->xy;
- } else if (st->airport_tile != INVALID_TILE) {
- const AirportSpec *as = st->GetAirportSpec();
- TILE_LOOP(tile, as->size_x, as->size_y, st->airport_tile) {
- if (!::IsHangar(tile)) return tile;
+ } else if (st->airport.tile != INVALID_TILE) {
+ TILE_AREA_LOOP(tile, st->airport) {
+ if (st->TileBelongsToAirport(tile) && !::IsHangar(tile)) return tile;
}
}
return INVALID_TILE;