client aim assist

This commit is contained in:
Skull Merlin 2022-02-28 22:49:10 +02:00
parent b7423d8109
commit 36db68dcd7
4 changed files with 18 additions and 4 deletions

View File

@ -146,6 +146,14 @@ namespace patches
reinterpret_cast<void(*)(game::mp::client_t*, game::msg_t*)>(0x140481A00)(client, msg);
}
void aim_assist_add_to_target_list(void* a1, void* a2)
{
if (!dvars::aimassist_enabled->current.enabled)
return;
game::AimAssist_AddToTargetList(a1, a2);
}
}
class component final : public component_interface
@ -194,10 +202,10 @@ namespace patches
utils::hook::call(0x1402BA26B, bsp_sys_error_stub); // H1(1.4)
// client side aim assist dvar
//dvars::aimassist_enabled = game::Dvar_RegisterBool("aimassist_enabled", true,
// game::DvarFlags::DVAR_FLAG_SAVED,
// "Enables aim assist for controllers");
//utils::hook::call(0x140003609, aim_assist_add_to_target_list);
dvars::aimassist_enabled = dvars::register_bool("aimassist_enabled", true,
game::DvarFlags::DVAR_FLAG_SAVED,
true);
utils::hook::call(0x14009EE9E, aim_assist_add_to_target_list);
// unlock all items
utils::hook::jump(0x140413E60, is_item_unlocked); // LiveStorage_IsItemUnlockedFromTable_LocalClient H1(1.4)

View File

@ -6,6 +6,8 @@
namespace dvars
{
game::dvar_t* aimassist_enabled = nullptr;
game::dvar_t* con_inputBoxColor = nullptr;
game::dvar_t* con_inputHintBoxColor = nullptr;
game::dvar_t* con_outputBarColor = nullptr;

View File

@ -6,6 +6,8 @@
namespace dvars
{
extern game::dvar_t* aimassist_enabled;
extern game::dvar_t* con_inputBoxColor;
extern game::dvar_t* con_inputHintBoxColor;
extern game::dvar_t* con_outputBarColor;

View File

@ -15,6 +15,8 @@ namespace game
WEAK symbol<void(const char* text_in)> Cmd_TokenizeString{0x140344110, 0x1404046F0};
WEAK symbol<void()> Cmd_EndTokenizeString{0x140343630, 0x140403C20};
WEAK symbol<void(void*, void*)> AimAssist_AddToTargetList{ 0, 0x14009D0F0 };
WEAK symbol<void()> Com_Frame_Try_Block_Function{0, 0x1400D8310};
WEAK symbol<CodPlayMode()> Com_GetCurrentCoDPlayMode{0, 0x1405039A0};
WEAK symbol<void(float, float, int)> Com_SetSlowMotion{0, 0x1400DB790};