diff --git a/src/company_base.h b/src/company_base.h --- a/src/company_base.h +++ b/src/company_base.h @@ -52,10 +52,10 @@ extern CompanyPool _company_pool; /** Statically loadable part of Company pool item */ struct CompanyProperties { uint32 name_2; ///< Parameter of #name_1. - uint16 name_1; ///< Name of the company if the user did not change it. + StringID name_1; ///< Name of the company if the user did not change it. char *name; ///< Name of the company if the user changed it. - uint16 president_name_1; ///< Name of the president if the user did not change it. + StringID president_name_1; ///< Name of the president if the user did not change it. uint32 president_name_2; ///< Parameter of #president_name_1 char *president_name; ///< Name of the president if the user changed it. diff --git a/src/saveload/company_sl.cpp b/src/saveload/company_sl.cpp --- a/src/saveload/company_sl.cpp +++ b/src/saveload/company_sl.cpp @@ -244,7 +244,7 @@ static const SaveLoad _company_desc[] = SLE_VAR(CompanyProperties, name_1, SLE_STRINGID), SLE_CONDSTR(CompanyProperties, name, SLE_STR | SLF_ALLOW_CONTROL, 0, 84, SL_MAX_VERSION), - SLE_VAR(CompanyProperties, president_name_1, SLE_UINT16), + SLE_VAR(CompanyProperties, president_name_1, SLE_STRINGID), SLE_VAR(CompanyProperties, president_name_2, SLE_UINT32), SLE_CONDSTR(CompanyProperties, president_name, SLE_STR | SLF_ALLOW_CONTROL, 0, 84, SL_MAX_VERSION), diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h --- a/src/saveload/saveload.h +++ b/src/saveload/saveload.h @@ -49,7 +49,7 @@ enum SavegameType { extern FileToSaveLoad _file_to_saveload; void GenerateDefaultSaveName(char *buf, const char *last); -void SetSaveLoadError(uint16 str); +void SetSaveLoadError(StringID str); const char *GetSaveLoadErrorString(); SaveOrLoadResult SaveOrLoad(const char *filename, SaveLoadOperation fop, DetailedFileType dft, Subdirectory sb, bool threaded = true); void WaitTillSaved(); @@ -161,7 +161,7 @@ enum VarTypes { SLE_INT64 = SLE_FILE_I64 | SLE_VAR_I64, SLE_UINT64 = SLE_FILE_U64 | SLE_VAR_U64, SLE_CHAR = SLE_FILE_I8 | SLE_VAR_CHAR, - SLE_STRINGID = SLE_FILE_STRINGID | SLE_VAR_U16, + SLE_STRINGID = SLE_FILE_STRINGID | SLE_VAR_U32, SLE_STRINGBUF = SLE_FILE_STRING | SLE_VAR_STRB, SLE_STRINGBQUOTE = SLE_FILE_STRING | SLE_VAR_STRBQ, SLE_STRING = SLE_FILE_STRING | SLE_VAR_STR, diff --git a/src/script/api/script_types.hpp b/src/script/api/script_types.hpp --- a/src/script/api/script_types.hpp +++ b/src/script/api/script_types.hpp @@ -98,7 +98,7 @@ typedef uint8 IndustryType; ///< The ID typedef OverflowSafeInt64 Money; ///< Money, stored in a 32bit/64bit safe way. For scripts money is always in pounds. typedef uint16 SignID; ///< The ID of a sign. typedef uint16 StationID; ///< The ID of a station. -typedef uint16 StringID; ///< The ID of a string. +typedef uint32 StringID; ///< The ID of a string. typedef uint16 SubsidyID; ///< The ID of a subsidy. typedef uint16 StoryPageID; ///< The ID of a story page. typedef uint16 StoryPageElementID; ///< The ID of a story page element. diff --git a/src/strings_type.h b/src/strings_type.h --- a/src/strings_type.h +++ b/src/strings_type.h @@ -15,8 +15,8 @@ /** * Numeric value that represents a string, independent of the selected language. */ -typedef uint16 StringID; -static const StringID INVALID_STRING_ID = 0xFFFF; ///< Constant representing an invalid string +typedef uint32 StringID; +static const StringID INVALID_STRING_ID = 0xFFFF; ///< Constant representing an invalid string (16bit in case it is used in savegames) static const int MAX_CHAR_LENGTH = 4; ///< Max. length of UTF-8 encoded unicode character static const uint MAX_LANG = 0x7F; ///< Maximum number of languages supported by the game, and the NewGRF specs