Merge pull request #151 from FreeSlave/predict_reload

Fix occasional double playing of reload animations
This commit is contained in:
nekonomicon 2021-02-10 18:38:47 +00:00 committed by GitHub
commit 76dfa83653
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -325,9 +325,13 @@ void CBasePlayerWeapon::ItemPostFrame( void )
{
if( ( m_fInReload ) && ( m_pPlayer->m_flNextAttack <= 0.0f ) )
{
#if 0 // FIXME, need ammo on client to make this work right
#if 1
// complete the reload.
int j = min( iMaxClip() - m_iClip, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] );
ItemInfo itemInfo;
memset( &itemInfo, 0, sizeof( itemInfo ) );
GetItemInfo( &itemInfo );
int j = Q_min( itemInfo.iMaxClip - m_iClip, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] );
// Add them to the clip
m_iClip += j;