diff --git a/src/Components/Modules/Gamepad.cpp b/src/Components/Modules/Gamepad.cpp index df3b12cc..c7679725 100644 --- a/src/Components/Modules/Gamepad.cpp +++ b/src/Components/Modules/Gamepad.cpp @@ -878,10 +878,10 @@ namespace Components } } - bool Gamepad::Gamepad_ShouldUse(const unsigned useTime) + bool Gamepad::Gamepad_ShouldUse(const Game::gentity_s* playerEnt, const unsigned useTime) { // Only apply hold time to +usereload keybind - return !Game::playersKb[Game::KB_USE_RELOAD].active || useTime >= static_cast(gpad_use_hold_time.get()); + return !(playerEnt->client->buttons & Game::CMD_BUTTON_USE_RELOAD) || useTime >= static_cast(gpad_use_hold_time.get()); } __declspec(naked) void Gamepad::Player_UseEntity_Stub() @@ -896,8 +896,9 @@ namespace Components push eax pushad push eax + push edi call Gamepad_ShouldUse - add esp,4 + add esp,8 mov [esp + 0x20],eax popad pop eax diff --git a/src/Components/Modules/Gamepad.hpp b/src/Components/Modules/Gamepad.hpp index d0e20d82..522afe33 100644 --- a/src/Components/Modules/Gamepad.hpp +++ b/src/Components/Modules/Gamepad.hpp @@ -355,7 +355,7 @@ namespace Components static void CL_GamepadMove(int gamePadIndex, Game::usercmd_s* cmd, float frameTimeBase); static void CL_MouseMove_Stub(); - static bool Gamepad_ShouldUse(unsigned useTime); + static bool Gamepad_ShouldUse(const Game::gentity_s* playerEnt, unsigned useTime); static void Player_UseEntity_Stub(); static bool Key_IsValidGamePadChar(int key); diff --git a/src/Game/Structs.hpp b/src/Game/Structs.hpp index 7dc0736c..b4d31f06 100644 --- a/src/Game/Structs.hpp +++ b/src/Game/Structs.hpp @@ -5262,7 +5262,13 @@ namespace Game unsigned int team; char pad2[436]; int flags; - char pad3[724]; + int spectatorClient; + int lastCmdTime; + int buttons; + int oldbuttons; + int latched_buttons; + int buttonsSinceLastFrame; + char pad3[700]; } gclient_t; struct EntHandle