summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-12-30 18:07:28 +0000
committerrubidium <rubidium@openttd.org>2009-12-30 18:07:28 +0000
commite6dbe673f04761752541435080d40b414dc02b78 (patch)
tree1d19a901e0fb1e98a440e63f5efbed40917fab1e /src
parent4801b17837a1f8e950c6da7544c1bd69f942b606 (diff)
downloadopenttd-e6dbe673f04761752541435080d40b414dc02b78.tar.xz
(svn r18667) -Fix [FS#3454]: [NoAI] crash when trying to get the order destination of a 'nearest depot' order
Diffstat (limited to 'src')
-rw-r--r--src/ai/api/ai_order.cpp3
1 files changed, 3 insertions, 0 deletions
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());