From 07fd1cef8ed22b317bc802339f69dfe5470b660a Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Tue, 6 Aug 2024 20:28:52 +0200 Subject: [PATCH] Client: add method to check if weapon is melee --- src/game/client/r1/c_weapon_x.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/game/client/r1/c_weapon_x.h b/src/game/client/r1/c_weapon_x.h index 1fc3248e..b424ddc7 100644 --- a/src/game/client/r1/c_weapon_x.h +++ b/src/game/client/r1/c_weapon_x.h @@ -12,6 +12,7 @@ public: float GetZoomFOVInterpAmount(const float curTime) const; inline bool HasTargetZoomFOV() { return m_playerData.GetTargetZoomFOV() == *(float*)&m_modVars[3120]; } + inline bool IsWeaponMelee() const { return (unsigned int)(*(_DWORD*)&m_modVars[3952] - 4) <= 1; } private: EHANDLE m_weaponOwner; float m_lastPrimaryAttack;