mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix #2301
Lanaguages were not falling back if there was a translated string further on in the langauge pack. This issue was caused by operating on an invalid string that was masked by a cast from a nullpointer to a size_t. The code now will not set the string if there is a nullptr
This commit is contained in:
parent
cd07fd5d4e
commit
faf5d9a043
|
@ -71,7 +71,8 @@ LanguagePack::LanguagePack(int id, const utf8 *text)
|
|||
|
||||
size_t stringDataBaseAddress = (size_t)_stringData;
|
||||
for (size_t i = 0; i < _strings.size(); i++) {
|
||||
_strings[i] = (utf8*)(stringDataBaseAddress + (size_t)_strings[i]);
|
||||
if (_strings[i] != nullptr)
|
||||
_strings[i] = (utf8*)(stringDataBaseAddress + (size_t)_strings[i]);
|
||||
}
|
||||
for (size_t i = 0; i < _objectOverrides.size(); i++) {
|
||||
for (int j = 0; j < ObjectOverrideMaxStringCount; j++) {
|
||||
|
|
Loading…
Reference in New Issue