summaryrefslogtreecommitdiff
path: root/src/order_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/order_cmd.cpp')
-rw-r--r--src/order_cmd.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index 3a6f59f20..4f97c782b 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -1389,6 +1389,10 @@ CommandCost CmdCloneOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
}
}
+ if (src->orders.list == NULL && !OrderList::CanAllocateItem()) {
+ return_cmd_error(STR_ERROR_NO_MORE_SPACE_FOR_ORDERS);
+ }
+
if (flags & DC_EXEC) {
/* If the destination vehicle had a OrderList, destroy it */
DeleteVehicleOrders(dst);