[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);
|
Localization::Set(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD Localization::SELoadLanguageStub()
|
void Localization::LoadLanguageStrings()
|
||||||
{
|
{
|
||||||
//if (ZoneBuilder::IsEnabled())
|
//if (ZoneBuilder::IsEnabled())
|
||||||
{
|
{
|
||||||
@ -144,8 +144,19 @@ namespace Components
|
|||||||
Game::SE_Load("localizedstrings/iw4x_english.str", 0);
|
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()
|
Localization::Localization()
|
||||||
|
@ -24,6 +24,7 @@ namespace Components
|
|||||||
static Dvar::Var UseLocalization;
|
static Dvar::Var UseLocalization;
|
||||||
|
|
||||||
static void __stdcall SetStringStub(const char* key, const char* value, bool isEnglish);
|
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