diff --git a/src/Components/Modules/CommonPatch.cpp b/src/Components/Modules/CommonPatch.cpp index 6dac29c..e5e5557 100644 --- a/src/Components/Modules/CommonPatch.cpp +++ b/src/Components/Modules/CommonPatch.cpp @@ -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() { Events::OnDvarInit([] @@ -614,6 +633,9 @@ namespace Components Utils::Hook(0x439A12, RegisterConColorStub4, 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 Utils::Hook::Nop(0x59681C, 8); Scheduler::Loop([] diff --git a/src/Components/Modules/CommonPatch.hpp b/src/Components/Modules/CommonPatch.hpp index 07ec6aa..0d2d3c7 100644 --- a/src/Components/Modules/CommonPatch.hpp +++ b/src/Components/Modules/CommonPatch.hpp @@ -27,5 +27,8 @@ namespace Components static bool CheckMilesFiles(); 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(); }; } \ No newline at end of file