summaryrefslogtreecommitdiffstats
path: root/src/weapons
diff options
context:
space:
mode:
author_AG <gennariarmando@outlook.com>2019-07-07 09:21:44 +0200
committerGitHub <noreply@github.com>2019-07-07 09:21:44 +0200
commit0ac6d0515e1ba703da2c0f742d91e7b550feac06 (patch)
tree2a5b1fc5511841acb443636b5a9b560d7aca5f2b /src/weapons
parentLil update. (diff)
parentsome work on vehicles (diff)
downloadre3-0ac6d0515e1ba703da2c0f742d91e7b550feac06.tar
re3-0ac6d0515e1ba703da2c0f742d91e7b550feac06.tar.gz
re3-0ac6d0515e1ba703da2c0f742d91e7b550feac06.tar.bz2
re3-0ac6d0515e1ba703da2c0f742d91e7b550feac06.tar.lz
re3-0ac6d0515e1ba703da2c0f742d91e7b550feac06.tar.xz
re3-0ac6d0515e1ba703da2c0f742d91e7b550feac06.tar.zst
re3-0ac6d0515e1ba703da2c0f742d91e7b550feac06.zip
Diffstat (limited to 'src/weapons')
-rw-r--r--src/weapons/Weapon.cpp6
-rw-r--r--src/weapons/Weapon.h1
2 files changed, 7 insertions, 0 deletions
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 a8a5d9b3..81516c4e 100644
--- a/src/weapons/Weapon.h
+++ b/src/weapons/Weapon.h
@@ -64,5 +64,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");