mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-24 12:06:41 +00:00
Codechange: replace 'new PoolItem(...' with 'PoolItem::Create(...'
This commit is contained in:
+2
-2
@@ -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 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user