mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-14 00:48:09 +00:00
Do not override IsUseable for mp5. Merge a9b1d9cda8
.
This commit is contained in:
parent
464a678b33
commit
593c9185aa
@ -270,12 +270,6 @@ void CMP5::WeaponIdle( void )
|
|||||||
m_flTimeWeaponIdle = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); // how long till we do this again.
|
m_flTimeWeaponIdle = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); // how long till we do this again.
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL CMP5::IsUseable()
|
|
||||||
{
|
|
||||||
//Can be used if the player has AR grenades. - Solokiller
|
|
||||||
return CBasePlayerWeapon::IsUseable() || m_pPlayer->m_rgAmmo[m_iSecondaryAmmoType] > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
class CMP5AmmoClip : public CBasePlayerAmmo
|
class CMP5AmmoClip : public CBasePlayerAmmo
|
||||||
{
|
{
|
||||||
void Spawn( void )
|
void Spawn( void )
|
||||||
|
@ -897,16 +897,38 @@ BOOL CBasePlayerWeapon::AddSecondaryAmmo( int iCount, char *szName, int iMax )
|
|||||||
//=========================================================
|
//=========================================================
|
||||||
BOOL CBasePlayerWeapon::IsUseable( void )
|
BOOL CBasePlayerWeapon::IsUseable( void )
|
||||||
{
|
{
|
||||||
if( m_iClip <= 0 )
|
if( m_iClip > 0 )
|
||||||
{
|
{
|
||||||
if( m_pPlayer->m_rgAmmo[PrimaryAmmoIndex()] <= 0 && iMaxAmmo1() != -1 )
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Player has unlimited ammo for this weapon or does not use magazines
|
||||||
|
if( iMaxAmmo1() == WEAPON_NOCLIP )
|
||||||
{
|
{
|
||||||
// clip is empty (or nonexistant) and the player has no more ammo of this type.
|
return TRUE;
|
||||||
return FALSE;
|
}
|
||||||
|
|
||||||
|
if( m_pPlayer->m_rgAmmo[PrimaryAmmoIndex()] > 0 )
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( pszAmmo2() )
|
||||||
|
{
|
||||||
|
// Player has unlimited ammo for this weapon or does not use magazines
|
||||||
|
if( iMaxAmmo2() == WEAPON_NOCLIP )
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( m_pPlayer->m_rgAmmo[SecondaryAmmoIndex()] > 0 )
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
// clip is empty (or nonexistant) and the player has no more ammo of this type.
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL CBasePlayerWeapon::CanDeploy( void )
|
BOOL CBasePlayerWeapon::CanDeploy( void )
|
||||||
|
@ -568,7 +568,6 @@ public:
|
|||||||
BOOL Deploy( void );
|
BOOL Deploy( void );
|
||||||
void Reload( void );
|
void Reload( void );
|
||||||
void WeaponIdle( void );
|
void WeaponIdle( void );
|
||||||
BOOL IsUseable();
|
|
||||||
float m_flNextAnimTime;
|
float m_flNextAnimTime;
|
||||||
int m_iShell;
|
int m_iShell;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user