summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-03-19 09:48:44 +0000
committeryexo <yexo@openttd.org>2010-03-19 09:48:44 +0000
commit414071d07f787042364fec573030720ba664154e (patch)
tree57593a3df5182caf905c03c7f99b0ac8802048ce /src/ai
parent81ca0e28c4504bbc7828df50b2086bbdb8776dd1 (diff)
downloadopenttd-414071d07f787042364fec573030720ba664154e.tar.xz
(svn r19463) -Codechange: add helper function to determine if an airport has at least one hangar
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/api/ai_order.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ai/api/ai_order.cpp b/src/ai/api/ai_order.cpp
index 6290525d5..500841415 100644
--- a/src/ai/api/ai_order.cpp
+++ b/src/ai/api/ai_order.cpp
@@ -181,7 +181,7 @@ 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());
- if (st->airport.GetSpec()->nof_depots == 0) return INVALID_TILE;
+ if (!st->airport.HasHangar()) return INVALID_TILE;
return st->GetHangarTile(0);
}