From cf57918d50e8c4d7166b79c25f7fb7bd73fcea66 Mon Sep 17 00:00:00 2001 From: FutureRave Date: Wed, 9 Nov 2022 15:22:35 +0000 Subject: [PATCH] [Localize] Remove patch that double loads str files --- src/Components/Modules/Localization.cpp | 28 ------------------------- src/Components/Modules/Localization.hpp | 2 -- 2 files changed, 30 deletions(-) diff --git a/src/Components/Modules/Localization.cpp b/src/Components/Modules/Localization.cpp index 03242b68..a860440a 100644 --- a/src/Components/Modules/Localization.cpp +++ b/src/Components/Modules/Localization.cpp @@ -76,31 +76,6 @@ namespace Components Localization::Set(key, value); } - void Localization::LoadLanguageStrings() - { - if (FileSystem::File(Utils::String::VA("localizedstrings/iw4x_%s.str", Game::Win_GetLanguage())).exists()) - { - Game::SE_Load(Utils::String::VA("localizedstrings/iw4x_%s.str", Game::Win_GetLanguage()), 0); - } - else if (FileSystem::File("localizedstrings/iw4x_english.str").exists()) - { - Game::SE_Load("localizedstrings/iw4x_english.str", 0); - } - } - - __declspec(naked) void Localization::SELoadLanguageStub() - { - __asm - { - pushad - call Localization::LoadLanguageStrings - popad - - push 629E20h - retn - } - } - void Localization::SetCredits() { static const char* staff[] = @@ -347,9 +322,6 @@ namespace Components // Resolving hook Utils::Hook(0x629B90, Localization::Get, HOOK_JUMP).install()->quick(); - // Set loading entry point - Utils::Hook(0x41D859, Localization::SELoadLanguageStub, HOOK_CALL).install()->quick(); - // Overwrite SetString Utils::Hook(0x4CE5EE, Localization::SetStringStub, HOOK_CALL).install()->quick(); diff --git a/src/Components/Modules/Localization.hpp b/src/Components/Modules/Localization.hpp index d745b7d5..2da7ba8e 100644 --- a/src/Components/Modules/Localization.hpp +++ b/src/Components/Modules/Localization.hpp @@ -17,8 +17,6 @@ namespace Components static Dvar::Var UseLocalization; static void __stdcall SetStringStub(const char* key, const char* value, bool isEnglish); - static void LoadLanguageStrings(); - static void SELoadLanguageStub(); static void SetCredits(); static const char* SEH_LocalizeTextMessageStub(const char* pszInputBuffer, const char* pszMessageType, Game::msgLocErrType_t errType);