From 08f5d5fb4507ebaf7152e01945242a57fd7ef61b Mon Sep 17 00:00:00 2001 From: quaK <38787176+Joelrau@users.noreply.github.com> Date: Sun, 25 Sep 2022 03:15:54 +0300 Subject: [PATCH] fix localized strings --- src/client/component/localized_strings.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/client/component/localized_strings.cpp b/src/client/component/localized_strings.cpp index 9056f606..2a15d1d2 100644 --- a/src/client/component/localized_strings.cpp +++ b/src/client/component/localized_strings.cpp @@ -19,16 +19,20 @@ namespace localized_strings const char* seh_string_ed_get_string(const char* reference) { - return localized_overrides.access([&](const localized_map& map) + const auto* str = localized_overrides.access([&](const localized_map& map) { const auto entry = map.find(reference); if (entry != map.end()) { - return utils::string::va("%s", entry->second.data()); + return entry->second.data(); } - - return seh_string_ed_get_string_hook.invoke(reference); + return static_cast(nullptr); }); + if (str != nullptr) + { + return str; + } + return seh_string_ed_get_string_hook.invoke(reference); } }