diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 504d2d39ae..6588e669b6 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -20,6 +20,7 @@ - Fix: [#11405] Building a path through walls does not always remove the walls. - Fix: [#11450] Rides with unsuitable track can't be opened even with "Enable all drawable track pieces" cheat. - Fix: [#11455] Object Selection window cuts off scenery names. +- Fix: [#11640] Objects with a blank description in one language do not fall back to other languages anymore. - Fix: RCT1 scenarios have more items in the object list than are present in the park or the research list. - Improved: [#6530] Allow water and land height changes on park borders. - Improved: [#11390] Build hash written to screenshot metadata. diff --git a/src/openrct2/object/StringTable.cpp b/src/openrct2/object/StringTable.cpp index e6c2ca6138..9691ec245d 100644 --- a/src/openrct2/object/StringTable.cpp +++ b/src/openrct2/object/StringTable.cpp @@ -56,21 +56,18 @@ void StringTable::Read(IReadObjectContext* context, IStream* stream, uint8_t id) { uint8_t languageId = (rct2LanguageId <= RCT2_LANGUAGE_ID_PORTUGUESE) ? RCT2ToOpenRCT2LanguageId[rct2LanguageId] : static_cast(LANGUAGE_UNDEFINED); - StringTableEntry entry{}; - entry.Id = id; - entry.LanguageId = languageId; - std::string stringAsWin1252 = stream->ReadStdString(); auto stringAsUtf8 = rct2_to_utf8(stringAsWin1252, rct2LanguageId); - if (StringIsBlank(stringAsUtf8.data())) + if (!StringIsBlank(stringAsUtf8.data())) { - entry.LanguageId = LANGUAGE_UNDEFINED; + stringAsUtf8 = String::Trim(stringAsUtf8); + StringTableEntry entry{}; + entry.Id = id; + entry.LanguageId = languageId; + entry.Text = stringAsUtf8; + _strings.push_back(entry); } - stringAsUtf8 = String::Trim(stringAsUtf8); - - entry.Text = stringAsUtf8; - _strings.push_back(entry); } } catch (const std::exception&)