summaryrefslogtreecommitdiff
path: root/src/order_backup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/order_backup.cpp')
-rw-r--r--src/order_backup.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/order_backup.cpp b/src/order_backup.cpp
index 1d490e726..38c4c8e67 100644
--- a/src/order_backup.cpp
+++ b/src/order_backup.cpp
@@ -263,6 +263,7 @@ CommandCost CmdClearOrderBackup(TileIndex tile, DoCommandFlag flags, uint32 p1,
for (Order *order = ob->orders; order != NULL; order = order->next) {
OrderType ot = order->GetType();
if (ot == OT_GOTO_DEPOT && (order->GetDepotActionType() & ODATFB_NEAREST_DEPOT) != 0) continue;
+ if (ot == OT_GOTO_DEPOT && hangar && !IsHangarTile(ob->tile)) continue; // Not an aircraft? Can't have a hangar order.
if (ot == OT_IMPLICIT || (IsHangarTile(ob->tile) && ot == OT_GOTO_DEPOT && !hangar)) ot = OT_GOTO_STATION;
if (ot == type && order->GetDestination() == destination) {
/* Remove the order backup! If a station/depot gets removed, we can't/shouldn't restore those broken orders. */