From 414071d07f787042364fec573030720ba664154e Mon Sep 17 00:00:00 2001 From: yexo Date: Fri, 19 Mar 2010 09:48:44 +0000 Subject: (svn r19463) -Codechange: add helper function to determine if an airport has at least one hangar --- src/ai/api/ai_order.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ai') 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); } -- cgit v1.2.3-70-g09d2