summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/order_cmd.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index 79a365f4c..aed5195fe 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -1521,9 +1521,7 @@ CommandCost CmdCloneOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
}
/* make sure there are orders available */
- int delta = dst->IsOrderListShared() ? src->GetNumOrders() + 1 : src->GetNumOrders() - dst->GetNumOrders();
- if (!Order::CanAllocateItem(delta) ||
- ((dst->orders.list == NULL || dst->IsOrderListShared()) && !OrderList::CanAllocateItem())) {
+ if (!Order::CanAllocateItem(src->GetNumOrders()) || !OrderList::CanAllocateItem()) {
return_cmd_error(STR_ERROR_NO_MORE_SPACE_FOR_ORDERS);
}