mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-11 15:38:12 +00:00
Fix occasional double playing of reload animations
This commit is contained in:
parent
9fc712da01
commit
06f046430d
@ -325,9 +325,13 @@ void CBasePlayerWeapon::ItemPostFrame( void )
|
|||||||
{
|
{
|
||||||
if( ( m_fInReload ) && ( m_pPlayer->m_flNextAttack <= 0.0f ) )
|
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.
|
// 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
|
// Add them to the clip
|
||||||
m_iClip += j;
|
m_iClip += j;
|
||||||
|
Loading…
Reference in New Issue
Block a user