diff options
author | rubidium42 <rubidium@openttd.org> | 2021-06-16 17:50:18 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-07-01 19:04:38 +0200 |
commit | aa9818db90b910b1b3d62d080f4a670a6a9d14af (patch) | |
tree | d3e76cefe6872f5c0b0b8edebef6cfed99f6bcab /src/company_cmd.cpp | |
parent | df601b8559b3d5de179b5b9e65ab9674fbd8bf5e (diff) | |
download | openttd-aa9818db90b910b1b3d62d080f4a670a6a9d14af.tar.xz |
Codechange: create a type for the "free_data" of NewsItems and (de)allocate it with new and delete
Diffstat (limited to 'src/company_cmd.cpp')
-rw-r--r-- | src/company_cmd.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index 1c79c4b8a..3c5e5f5c7 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -376,7 +376,7 @@ set_name:; MarkWholeScreenDirty(); if (c->is_ai) { - CompanyNewsInformation *cni = MallocT<CompanyNewsInformation>(1); + CompanyNewsInformation *cni = new CompanyNewsInformation(); cni->FillData(c); SetDParam(0, STR_NEWS_COMPANY_LAUNCH_TITLE); SetDParam(1, STR_NEWS_COMPANY_LAUNCH_DESCRIPTION); @@ -888,7 +888,7 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 /* Delete any open window of the company */ CloseCompanyWindows(c->index); - CompanyNewsInformation *cni = MallocT<CompanyNewsInformation>(1); + CompanyNewsInformation *cni = new CompanyNewsInformation(); cni->FillData(c); /* Show the bankrupt news */ |