From b206e2b97d2b87db0513041ceee1131ac0c9075c Mon Sep 17 00:00:00 2001 From: tankefugl Date: Tue, 5 Apr 2005 14:14:29 +0000 Subject: [PATCH] Mantis 0000996: Added checks to m_fInReload to prevent an empty weapon from going in a reloading loop. git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@34 67975925-1194-0748-b3d5-c16f83f1a3a1 --- main/source/mod/AvHBasePlayerWeapon.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main/source/mod/AvHBasePlayerWeapon.cpp b/main/source/mod/AvHBasePlayerWeapon.cpp index be8b61c6..1879062f 100644 --- a/main/source/mod/AvHBasePlayerWeapon.cpp +++ b/main/source/mod/AvHBasePlayerWeapon.cpp @@ -243,6 +243,11 @@ BOOL AvHBasePlayerWeapon::DefaultDeploy( char *szViewModel, char *szWeaponModel, BOOL AvHBasePlayerWeapon::DefaultReload( int iClipSize, int iAnim, float fDelay, int body) { + // tankefugl: 0000996 + if (m_fInReload == TRUE) + return TRUE; + // :tankefugl + if (m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0) return FALSE; @@ -251,7 +256,7 @@ BOOL AvHBasePlayerWeapon::DefaultReload( int iClipSize, int iAnim, float fDelay, { return FALSE; } - + int j = min(iClipSize - m_iClip, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]); if (j == 0) @@ -704,7 +709,8 @@ bool AvHBasePlayerWeapon::ProcessValidAttack(void) // puzl: 497 call GetEnabledState instead of testing directly int enabledState=this->GetEnabledState(); - if(this->m_pPlayer->pev->viewmodel && ( enabledState == 1)) + // tankefugl: 0000996 - added check vs m_fInReload + if(this->m_pPlayer->pev->viewmodel && ( enabledState == 1) && (m_fInReload == FALSE)) { // don't fire underwater if((this->m_pPlayer->pev->waterlevel == 3) && !this->GetFiresUnderwater())