From 3e0e3cfac150d7a63a714a0af073caaabfffbaa2 Mon Sep 17 00:00:00 2001 From: Samu Date: Tue, 2 Oct 2018 00:27:07 +0100 Subject: [PATCH] Fix: Direct the aircraft to the correct location of the hangar when skipping to a go to hangar order When manually skipping to a 'go to hangar' order in the order list, while the aircraft is flying, direct the aircraft to the correct location of the hangar. --- src/order_cmd.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index d9d741dbce..83dacdca45 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -2093,6 +2093,13 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool } else { if (v->type != VEH_AIRCRAFT) { v->SetDestTile(Depot::Get(order->GetDestination())->xy); + } else { + Aircraft *a = Aircraft::From(v); + DestinationID destination = a->current_order.GetDestination(); + if (a->targetairport != destination) { + /* The aircraft is now heading for a different hangar than the next in the orders */ + a->SetDestTile(a->GetOrderStationLocation(destination)); + } } return true; }