1
0
Fork 0

Codefix: Company name is a StringID. (#13224)

StringID was passed to Company's constructor as a uint16_t.
pull/13227/head
Peter Nelson 2025-01-01 20:16:59 +00:00 committed by GitHub
parent 31fd71e1ac
commit e9e603b4fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -131,7 +131,7 @@ struct CompanyProperties {
}; };
struct Company : CompanyProperties, CompanyPool::PoolItem<&_company_pool> { 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(); ~Company();
RailTypes avail_railtypes; ///< Rail types available to this company. RailTypes avail_railtypes; ///< Rail types available to this company.

View File

@ -63,7 +63,7 @@ INSTANTIATE_POOL_METHODS(Company)
* @param name_1 Name of the company. * @param name_1 Name of the company.
* @param is_ai A computer program is running for this 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->name_1 = name_1;
this->location_of_HQ = INVALID_TILE; this->location_of_HQ = INVALID_TILE;

View File

@ -1025,7 +1025,7 @@ static bool LoadOldCompany(LoadgameState *ls, int num)
if (num == 0) { if (num == 0) {
/* If the first company has no name, make sure we call it UNNAMED */ /* 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; c->name_1 = STR_SV_UNNAMED;
} }
} else { } else {