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.
pull/78/head
Samu 6 years ago committed by Niels Martin Hansen
parent 2084779b5a
commit 3e0e3cfac1

@ -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;
}

Loading…
Cancel
Save