mirror of https://github.com/FWGS/hlsdk-xash3d
Merge pull request #154 from FreeSlave/fix_mp5_pickup
Fix a bug with extracting ammo from mp5 when argrenades are full
This commit is contained in:
commit
c8ad4a45e5
|
@ -1099,13 +1099,13 @@ int CBasePlayerWeapon::ExtractAmmo( CBasePlayerWeapon *pWeapon )
|
||||||
{
|
{
|
||||||
// blindly call with m_iDefaultAmmo. It's either going to be a value or zero. If it is zero,
|
// blindly call with m_iDefaultAmmo. It's either going to be a value or zero. If it is zero,
|
||||||
// we only get the ammo in the weapon's clip, which is what we want.
|
// we only get the ammo in the weapon's clip, which is what we want.
|
||||||
iReturn = pWeapon->AddPrimaryAmmo( m_iDefaultAmmo, (char *)pszAmmo1(), iMaxClip(), iMaxAmmo1() );
|
iReturn |= pWeapon->AddPrimaryAmmo( m_iDefaultAmmo, (char *)pszAmmo1(), iMaxClip(), iMaxAmmo1() );
|
||||||
m_iDefaultAmmo = 0;
|
m_iDefaultAmmo = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( pszAmmo2() != NULL )
|
if( pszAmmo2() != NULL )
|
||||||
{
|
{
|
||||||
iReturn = pWeapon->AddSecondaryAmmo( 0, (char *)pszAmmo2(), iMaxAmmo2() );
|
iReturn |= pWeapon->AddSecondaryAmmo( 0, (char *)pszAmmo2(), iMaxAmmo2() );
|
||||||
}
|
}
|
||||||
|
|
||||||
return iReturn;
|
return iReturn;
|
||||||
|
|
Loading…
Reference in New Issue