Codechange: Move ownership of Orders to OrderList. (#13948)
Removes the orders pool, and orders are now stored directly in each OrderList. Iterating orders now no longer needs to traverse a linked-list, all orders in an OrderList are sequential.
This commit is contained in:
@@ -248,10 +248,7 @@ CommandCost CmdSellVehicle(DoCommandFlags flags, VehicleID v_id, bool sell_chain
|
||||
if (!front->IsStoppedInDepot()) return CommandCost(STR_ERROR_TRAIN_MUST_BE_STOPPED_INSIDE_DEPOT + front->type);
|
||||
|
||||
/* Can we actually make the order backup, i.e. are there enough orders? */
|
||||
if (backup_order &&
|
||||
front->orders != nullptr &&
|
||||
!front->orders->IsShared() &&
|
||||
!Order::CanAllocateItem(front->orders->GetNumOrders())) {
|
||||
if (backup_order && front->orders != nullptr && !front->orders->IsShared()) {
|
||||
/* Only happens in exceptional cases when there aren't enough orders anyhow.
|
||||
* Thus it should be safe to just drop the orders in that case. */
|
||||
backup_order = false;
|
||||
|
||||
Reference in New Issue
Block a user