1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-29 23:24:31 +01:00

Codechange: replace 'new PoolItem(...' with 'PoolItem::Create(...'

This commit is contained in:
Rubidium
2026-01-03 11:45:18 +01:00
committed by rubidium42
parent bc842811fc
commit 2fcd4e189a
49 changed files with 162 additions and 114 deletions

View File

@@ -847,7 +847,7 @@ void InsertOrder(Vehicle *v, Order &&new_o, VehicleOrderID sel_ord)
{
/* Create new order and link in list */
if (v->orders == nullptr) {
v->orders = new OrderList(std::move(new_o), v);
v->orders = OrderList::Create(std::move(new_o), v);
} else {
v->orders->InsertOrderAt(std::move(new_o), sel_ord);
}
@@ -1604,7 +1604,7 @@ CommandCost CmdCloneOrder(DoCommandFlags flags, CloneOptions action, VehicleID v
}
assert(OrderList::CanAllocateItem());
dst->orders = new OrderList(std::move(dst_orders), dst);
dst->orders = OrderList::Create(std::move(dst_orders), dst);
InvalidateVehicleOrder(dst, VIWD_REMOVE_ALL_ORDERS);