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

This commit is contained in:
Rubidium
2026-01-03 16:04:32 +01:00
committed by rubidium42
parent bc842811fc
commit 2fcd4e189a
49 changed files with 162 additions and 114 deletions
+2 -2
View File
@@ -57,7 +57,7 @@ void OrderBackup::DoRestore(Vehicle *v)
if (this->clone != nullptr) {
Command<CMD_CLONE_ORDER>::Do(DoCommandFlag::Execute, CO_SHARE, v->index, this->clone->index);
} else if (!this->orders.empty() && OrderList::CanAllocateItem()) {
v->orders = new OrderList(std::move(this->orders), v);
v->orders = OrderList::Create(std::move(this->orders), v);
/* Make sure buoys/oil rigs are updated in the station list. */
InvalidateWindowClassesData(WC_STATION_LIST, 0);
}
@@ -89,7 +89,7 @@ void OrderBackup::DoRestore(Vehicle *v)
if (ob->user == user) delete ob;
}
if (OrderBackup::CanAllocateItem()) {
new OrderBackup(v, user);
OrderBackup::Create(v, user);
}
}