diff src/ai/api/ai_order.cpp @ 14120:b1881bbcee28 draft

(svn r18667) -Fix [FS#3454]: [NoAI] crash when trying to get the order destination of a 'nearest depot' order
author rubidium <rubidium@openttd.org>
date Wed, 30 Dec 2009 18:07:28 +0000 (2009-12-30)
parents 4d50ab271097
children 82f1453a12d5
line wrap: on
line diff
--- a/src/ai/api/ai_order.cpp
+++ b/src/ai/api/ai_order.cpp
@@ -175,6 +175,9 @@
 
 	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());