diff --git a/src/Components/Modules/Weapon.cpp b/src/Components/Modules/Weapon.cpp index 6ed984da..072d506b 100644 --- a/src/Components/Modules/Weapon.cpp +++ b/src/Components/Modules/Weapon.cpp @@ -83,6 +83,12 @@ namespace Components } } + int Weapon::ClearConfigStrings(void* dest, int value, int size) + { + memset(Utils::Hook::Get(0x405B72), value, MAX_CONFIGSTRINGS * 2); + return Utils::Hook::Call(0x4C98D0)(dest, value, size); // Com_Memset + } + void Weapon::PatchConfigStrings() { Utils::Hook::Set(0x4347A7, MAX_CONFIGSTRINGS); @@ -150,6 +156,7 @@ namespace Components //Utils::Hook::Set(0x6083D6, &configStrings[ARRAYSIZE(configStrings)]); //Utils::Hook::Set(0x60848E, &configStrings[ARRAYSIZE(configStrings)]); + Utils::Hook(0x405BBE, Weapon::ClearConfigStrings, HOOK_CALL).install()->quick(); Utils::Hook(0x593CA4, Weapon::ParseConfigStrings, HOOK_CALL).install()->quick(); Utils::Hook(0x4BD52D, Weapon::GetWeaponConfigString, HOOK_CALL).install()->quick(); Utils::Hook(0x45D170, Weapon::SaveRegisteredWeapons, HOOK_JUMP).install()->quick(); diff --git a/src/Components/Modules/Weapon.hpp b/src/Components/Modules/Weapon.hpp index c9dc3b7d..1f785b35 100644 --- a/src/Components/Modules/Weapon.hpp +++ b/src/Components/Modules/Weapon.hpp @@ -26,5 +26,6 @@ namespace Components static void ParseConfigStrings(); static int ParseWeaponConfigStrings(); + static int ClearConfigStrings(void* dest, int value, int size); }; } diff --git a/src/Game/Structs.hpp b/src/Game/Structs.hpp index 3b55e2c5..a501def1 100644 --- a/src/Game/Structs.hpp +++ b/src/Game/Structs.hpp @@ -129,6 +129,7 @@ namespace Game dvar_value_t _default; //48:64 dvar_maxmin_t min; //65:67 dvar_maxmin_t max; //68:72 woooo + bool(*callback)(dvar_t* dvar, dvar_value_t value); } dvar_t; typedef struct cmd_function_s