forked from mirror/OpenTTD
(svn r22024) -Fix [FS#4468]: verify we can allocate an OrderList before we actually try to do so (Rubidium)
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user