[CommonPatch]: Fixed reading data from raw files.
This commit is contained in:
parent
aaf8e6aba9
commit
5879552eab
@ -481,6 +481,25 @@ namespace Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Game::dvar_s* CommonPatch::fs_usedevdir_fix(const char* dvarName, int type, unsigned __int16 flags, float r, float g, float b, float a, float min, float max, const char* description)
|
||||||
|
{
|
||||||
|
// meme: https://imgur.com/a/tczYKGR
|
||||||
|
return Dvars::Register::Dvar_RegisterBool(dvarName, description, true, Game::saved);
|
||||||
|
}
|
||||||
|
|
||||||
|
void __declspec(naked) CommonPatch::fs_usedevdir_register_stub()
|
||||||
|
{
|
||||||
|
const static uint32_t retn_addr = 0x57AC09;
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
push edi;
|
||||||
|
call fs_usedevdir_fix;
|
||||||
|
add esp, 4;
|
||||||
|
jmp retn_addr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CommonPatch::CommonPatch()
|
CommonPatch::CommonPatch()
|
||||||
{
|
{
|
||||||
Events::OnDvarInit([]
|
Events::OnDvarInit([]
|
||||||
@ -614,6 +633,9 @@ namespace Components
|
|||||||
Utils::Hook(0x439A12, RegisterConColorStub4, HOOK_JUMP).install()->quick();
|
Utils::Hook(0x439A12, RegisterConColorStub4, HOOK_JUMP).install()->quick();
|
||||||
Utils::Hook(0x439A5B, RegisterConColorStub5, HOOK_JUMP).install()->quick();
|
Utils::Hook(0x439A5B, RegisterConColorStub5, HOOK_JUMP).install()->quick();
|
||||||
|
|
||||||
|
// Fix the 'fs_usedevdir' skill issue
|
||||||
|
Utils::Hook(0x57AC04, fs_usedevdir_register_stub, HOOK_JUMP).install()->quick();
|
||||||
|
|
||||||
// Mouse fix
|
// Mouse fix
|
||||||
Utils::Hook::Nop(0x59681C, 8);
|
Utils::Hook::Nop(0x59681C, 8);
|
||||||
Scheduler::Loop([]
|
Scheduler::Loop([]
|
||||||
|
@ -27,5 +27,8 @@ namespace Components
|
|||||||
|
|
||||||
static bool CheckMilesFiles();
|
static bool CheckMilesFiles();
|
||||||
static const char* __stdcall AIL_set_redist_directory_Stub(const char* directory);
|
static const char* __stdcall AIL_set_redist_directory_Stub(const char* directory);
|
||||||
|
|
||||||
|
static Game::dvar_s* fs_usedevdir_fix(const char* dvarName, int type, unsigned __int16 flags, float r, float g, float b, float a, float min, float max, const char* description);
|
||||||
|
static void fs_usedevdir_register_stub();
|
||||||
};
|
};
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user