summaryrefslogtreecommitdiffstats
path: root/src/weapons/Weapon.cpp
diff options
context:
space:
mode:
authorerorcun <erayorcunus@gmail.com>2020-01-07 15:23:09 +0100
committerGitHub <noreply@github.com>2020-01-07 15:23:09 +0100
commitf9316d9cc3cfb748366758c41cf02634b6df9a08 (patch)
treecb7dafc76cb2966ac86d908fd5d99c3b7c164cf0 /src/weapons/Weapon.cpp
parentMerge pull request #285 from Nick007J/script_dev (diff)
downloadre3-f9316d9cc3cfb748366758c41cf02634b6df9a08.tar
re3-f9316d9cc3cfb748366758c41cf02634b6df9a08.tar.gz
re3-f9316d9cc3cfb748366758c41cf02634b6df9a08.tar.bz2
re3-f9316d9cc3cfb748366758c41cf02634b6df9a08.tar.lz
re3-f9316d9cc3cfb748366758c41cf02634b6df9a08.tar.xz
re3-f9316d9cc3cfb748366758c41cf02634b6df9a08.tar.zst
re3-f9316d9cc3cfb748366758c41cf02634b6df9a08.zip
Diffstat (limited to '')
-rw-r--r--src/weapons/Weapon.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp
index 860e3ab2..8019a1cf 100644
--- a/src/weapons/Weapon.cpp
+++ b/src/weapons/Weapon.cpp
@@ -45,7 +45,7 @@ CWeapon::Reload(void)
bool
CWeapon::IsType2Handed(void)
{
- return m_eWeaponType >= WEAPONTYPE_SHOTGUN && m_eWeaponType <= WEAPONTYPE_FLAMETHROWER && m_eWeaponType != WEAPONTYPE_ROCKETLAUNCHER;
+ return m_eWeaponType >= WEAPONTYPE_SHOTGUN && m_eWeaponType <= WEAPONTYPE_FLAMETHROWER && m_eWeaponType != WEAPONTYPE_ROCKETLAUNCHER;
}
bool
@@ -88,8 +88,20 @@ CWeapon::HitsGround(CEntity *holder, CVector *firePos, CEntity *aimingTo)
return false;
}
+bool
+CWeapon::HasWeaponAmmoToBeUsed(void)
+{
+ switch (m_eWeaponType) {
+ case WEAPONTYPE_UNARMED:
+ case WEAPONTYPE_BASEBALLBAT:
+ return true;
+ default:
+ return m_nAmmoTotal != 0;
+ }
+}
+
STARTPATCHES
InjectHook(0x55C330, &CWeapon::Initialise, PATCH_JUMP);
InjectHook(0x5639D0, &CWeapon::Reload, PATCH_JUMP);
InjectHook(0x564890, &CWeapon::HitsGround, PATCH_JUMP);
-ENDPATCHES \ No newline at end of file
+ENDPATCHES