Weapon fixes

This commit is contained in:
eray orçunus
2020-05-16 15:07:09 +03:00
parent 793a6a6d7e
commit 40ee29fb99
7 changed files with 59 additions and 31 deletions

View File

@ -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

View File

@ -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;

View File

@ -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;