From e6dbe673f04761752541435080d40b414dc02b78 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 30 Dec 2009 18:07:28 +0000 Subject: (svn r18667) -Fix [FS#3454]: [NoAI] crash when trying to get the order destination of a 'nearest depot' order --- src/ai/api/ai_order.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/ai/api/ai_order.cpp b/src/ai/api/ai_order.cpp index 92c9e5dc0..1062e501a 100644 --- a/src/ai/api/ai_order.cpp +++ b/src/ai/api/ai_order.cpp @@ -175,6 +175,9 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or switch (order->GetType()) { case OT_GOTO_DEPOT: { + /* We don't know where the nearest depot is... (yet) */ + if (order->GetDepotActionType() & ODATFB_NEAREST_DEPOT) return INVALID_TILE; + 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()); -- cgit v1.2.3-54-g00ecf