diff options
Diffstat (limited to 'src/weapons')
-rw-r--r-- | src/weapons/Weapon.cpp | 16 | ||||
-rw-r--r-- | src/weapons/Weapon.h | 4 | ||||
-rw-r--r-- | src/weapons/WeaponInfo.h | 2 |
3 files changed, 12 insertions, 10 deletions
diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp index deb77cb9..1ae26106 100644 --- a/src/weapons/Weapon.cpp +++ b/src/weapons/Weapon.cpp @@ -2312,13 +2312,15 @@ CWeapon::BlowUpExplosiveThings(CEntity *thing) bool CWeapon::HasWeaponAmmoToBeUsed(void) { - switch (m_eWeaponType) { - case WEAPONTYPE_UNARMED: - case WEAPONTYPE_BASEBALLBAT: - return true; - default: - return m_nAmmoTotal != 0; - } + // FIX: This is better (not bug tho) +#if 0 + if (m_eWeaponType <= WEAPONTYPE_CHAINSAW) +#else + if (CWeaponInfo::GetWeaponInfo(m_eWeaponType)->m_eWeaponFire == WEAPON_FIRE_MELEE) +#endif + return true; + else + return m_nAmmoTotal != 0; } bool diff --git a/src/weapons/Weapon.h b/src/weapons/Weapon.h index 32322da0..5c62a74b 100644 --- a/src/weapons/Weapon.h +++ b/src/weapons/Weapon.h @@ -16,8 +16,8 @@ class CWeapon public: eWeaponType m_eWeaponType; eWeaponState m_eWeaponState; - uint32 m_nAmmoInClip; - uint32 m_nAmmoTotal; + int32 m_nAmmoInClip; + int32 m_nAmmoTotal; uint32 m_nTimer; bool m_bAddRotOffset; diff --git a/src/weapons/WeaponInfo.h b/src/weapons/WeaponInfo.h index cb10f095..41450047 100644 --- a/src/weapons/WeaponInfo.h +++ b/src/weapons/WeaponInfo.h @@ -14,7 +14,7 @@ public: float m_fRange; uint32 m_nFiringRate; uint32 m_nReload; - uint32 m_nAmountofAmmunition; + int32 m_nAmountofAmmunition; uint32 m_nDamage; float m_fSpeed; float m_fRadius; |