diff options
author | Samu <dj_samu@hotmail.com> | 2018-10-02 00:27:07 +0100 |
---|---|---|
committer | Niels Martin Hansen <nielsm@indvikleren.dk> | 2019-01-27 12:33:54 +0100 |
commit | 3e0e3cfac150d7a63a714a0af073caaabfffbaa2 (patch) | |
tree | 55575f8ed300e720d9991f93d04fb687093eed0e /src | |
parent | 2084779b5a9d16d6d04744c913960fd59bde2356 (diff) | |
download | openttd-3e0e3cfac150d7a63a714a0af073caaabfffbaa2.tar.xz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/order_cmd.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index d9d741dbc..83dacdca4 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; } |