mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-10 08:00:05 +00:00
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.
This commit is contained in:
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…
Reference in New Issue
Block a user