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:
duncanspumpkin 2015-11-15 09:55:01 +00:00
parent cd07fd5d4e
commit faf5d9a043
1 changed files with 2 additions and 1 deletions

View File

@ -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++) {