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
@@ -60,7 +60,7 @@ std::tuple<CommandCost, LeagueTableID> CmdCreateLeagueTable(DoCommandFlags flags
if (title.empty()) return { CMD_ERROR, LeagueTableID::Invalid() };
if (flags.Test(DoCommandFlag::Execute)) {
LeagueTable *lt = new LeagueTable(title, header, footer);
LeagueTable *lt = LeagueTable::Create(title, header, footer);
return { CommandCost(), lt->index };
}
@@ -89,7 +89,7 @@ std::tuple<CommandCost, LeagueTableElementID> CmdCreateLeagueTableElement(DoComm
if (company != CompanyID::Invalid() && !Company::IsValidID(company)) return { CMD_ERROR, LeagueTableElementID::Invalid() };
if (flags.Test(DoCommandFlag::Execute)) {
LeagueTableElement *lte = new LeagueTableElement(table, rating, company, text, score, link);
LeagueTableElement *lte = LeagueTableElement::Create(table, rating, company, text, score, link);
InvalidateWindowData(WC_COMPANY_LEAGUE, table);
return { CommandCost(), lte->index };
}