(svn r23849) -Fix [FS#5008]: when the network is lagging, you try to copy a vehicle's order but accidentally create a station order and then copy the vehicle's order (before the first command is executed) one could trigger an assertion from the pool. Simplify the ancient code and make it more fool proof, even though it could stop copying a vehicle's orders slightly earlier than it would now... but who has come near that limit and really needed that many orders?

pull/155/head
rubidium 13 years ago
parent 46068abb1a
commit 8025579827

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

Loading…
Cancel
Save