From e9e603b4fd70ee3c7968c4ef9b4b55dbe23bc1f9 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Wed, 1 Jan 2025 20:16:59 +0000 Subject: [PATCH] Codefix: Company name is a StringID. (#13224) StringID was passed to Company's constructor as a uint16_t. --- src/company_base.h | 2 +- src/company_cmd.cpp | 2 +- src/saveload/oldloader_sl.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/company_base.h b/src/company_base.h index 24f9051fc2..810c6c90d3 100644 --- a/src/company_base.h +++ b/src/company_base.h @@ -131,7 +131,7 @@ struct CompanyProperties { }; struct Company : CompanyProperties, CompanyPool::PoolItem<&_company_pool> { - Company(uint16_t name_1 = 0, bool is_ai = false); + Company(StringID name_1 = STR_NULL, bool is_ai = false); ~Company(); RailTypes avail_railtypes; ///< Rail types available to this company. diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index 7f37cc585e..91e2cd70a9 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -63,7 +63,7 @@ INSTANTIATE_POOL_METHODS(Company) * @param name_1 Name of the company. * @param is_ai A computer program is running for this company. */ -Company::Company(uint16_t name_1, bool is_ai) +Company::Company(StringID name_1, bool is_ai) { this->name_1 = name_1; this->location_of_HQ = INVALID_TILE; diff --git a/src/saveload/oldloader_sl.cpp b/src/saveload/oldloader_sl.cpp index a8b7a452e4..fa77ca7df6 100644 --- a/src/saveload/oldloader_sl.cpp +++ b/src/saveload/oldloader_sl.cpp @@ -1025,7 +1025,7 @@ static bool LoadOldCompany(LoadgameState *ls, int num) if (num == 0) { /* If the first company has no name, make sure we call it UNNAMED */ - if (c->name_1 == 0) { + if (c->name_1 == STR_NULL) { c->name_1 = STR_SV_UNNAMED; } } else {