[Localization] Fix localization crash
Preserve esi, as it is required by the hooked function
This commit is contained in:
parent
8085e4bd88
commit
1d13548829
@ -131,7 +131,7 @@ namespace Components
|
||||
Localization::Set(key, value);
|
||||
}
|
||||
|
||||
DWORD Localization::SELoadLanguageStub()
|
||||
void Localization::LoadLanguageStrings()
|
||||
{
|
||||
//if (ZoneBuilder::IsEnabled())
|
||||
{
|
||||
@ -144,8 +144,19 @@ namespace Components
|
||||
Game::SE_Load("localizedstrings/iw4x_english.str", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Utils::Hook::Call<DWORD()>(0x629E20)();
|
||||
__declspec(naked) void Localization::SELoadLanguageStub()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
pushad
|
||||
call Localization::LoadLanguageStrings
|
||||
popad
|
||||
|
||||
push 629E20h
|
||||
retn
|
||||
}
|
||||
}
|
||||
|
||||
Localization::Localization()
|
||||
|
@ -7,7 +7,7 @@ namespace Components
|
||||
~Localization();
|
||||
|
||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||
const char* getName() { return "Localization"; };
|
||||
const char* getName() { return "Localization"; };
|
||||
#endif
|
||||
|
||||
static void Set(std::string key, std::string value);
|
||||
@ -24,6 +24,7 @@ namespace Components
|
||||
static Dvar::Var UseLocalization;
|
||||
|
||||
static void __stdcall SetStringStub(const char* key, const char* value, bool isEnglish);
|
||||
static DWORD SELoadLanguageStub();
|
||||
static void LoadLanguageStrings();
|
||||
static void SELoadLanguageStub();
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user