From 0e7a471b82129bcdea3f691744ed8db4717c3153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Sat, 6 Jul 2019 01:44:49 +0300 Subject: CPed... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: eray orçunus --- src/weapons/Weapon.cpp | 6 ++++++ src/weapons/Weapon.h | 1 + 2 files changed, 7 insertions(+) (limited to 'src/weapons') diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp index 0c48db6b..90a6408b 100644 --- a/src/weapons/Weapon.cpp +++ b/src/weapons/Weapon.cpp @@ -35,6 +35,12 @@ CWeapon::Reload(void) m_nAmmoInClip = m_nAmmoTotal; } +bool +CWeapon::IsTypeMelee(void) +{ + return m_eWeaponType == WEAPONTYPE_UNARMED || m_eWeaponType == WEAPONTYPE_BASEBALLBAT; +} + STARTPATCHES InjectHook(0x55C330, &CWeapon::Initialise, PATCH_JUMP); InjectHook(0x5639D0, &CWeapon::Reload, PATCH_JUMP); diff --git a/src/weapons/Weapon.h b/src/weapons/Weapon.h index 8cb435ce..ba552035 100644 --- a/src/weapons/Weapon.h +++ b/src/weapons/Weapon.h @@ -58,5 +58,6 @@ public: void Reload(void); bool Fire(CEntity*, CVector*); void AddGunshell(CEntity*, CVector const&, CVector2D const&, float); + bool IsTypeMelee(void); }; static_assert(sizeof(CWeapon) == 0x18, "CWeapon: error"); -- cgit v1.2.3