sp/src/game/shared/hl2/basehlcombatweapon_shared.cpp
void CBaseHLCombatWeapon::WeaponIdle( void )
{
	//See if we should idle high or low
	if ( WeaponShouldBeLowered() )
	{
#if !defined( CLIENT_DLL )
		CHL2_Player *pPlayer = dynamic_cast<CHL2_Player*>(GetOwner());

		if( pPlayer )
		{
			pPlayer->Weapon_Lower();
		}
#endif

		// Move to lowered position if we're not there yet
		if ( GetActivity() != ACT_VM_IDLE_LOWERED && GetActivity() != ACT_VM_IDLE_TO_LOWERED 
			 && GetActivity() != ACT_TRANSITION )
		{
			SendWeaponAnim( ACT_VM_IDLE_LOWERED );
		}
		else if ( HasWeaponIdleTimeElapsed() )
		{
			// Keep idling low
			SendWeaponAnim( ACT_VM_IDLE_LOWERED );
		}
	}
	else
	{
		// See if we need to raise immediately
		if ( m_flRaiseTime < gpGlobals->curtime && GetActivity() == ACT_VM_IDLE_LOWERED ) 
		{
			SendWeaponAnim( ACT_VM_IDLE );
		}
		else if ( HasWeaponIdleTimeElapsed() ) 
		{
			SendWeaponAnim( ACT_VM_IDLE );
		}
	}
}
//-----------------------------------------------------------------------------
// Purpose: Allows the weapon to choose proper weapon idle animation
//-----------------------------------------------------------------------------
Allows the weapon to choose proper weapon idle animation
Allows the weapon to choose proper weapon idle animation
void CBaseHLCombatWeapon::WeaponIdle( void )
{
	if ( WeaponShouldBeLowered() )
	{
#if !defined( CLIENT_DLL )
		CHL2_Player *pPlayer = dynamic_cast<CHL2_Player*>(GetOwner());
		if( pPlayer )
		{
			pPlayer->Weapon_Lower();
		}
#endif
		if ( GetActivity() != ACT_VM_IDLE_LOWERED && GetActivity() != ACT_VM_IDLE_TO_LOWERED 
			 && GetActivity() != ACT_TRANSITION )
		{
			SendWeaponAnim( ACT_VM_IDLE_LOWERED );
		}
		else if ( HasWeaponIdleTimeElapsed() )
		{
			SendWeaponAnim( ACT_VM_IDLE_LOWERED );
		}
	}
	else
	{
		if ( m_flRaiseTime < gpGlobals->curtime && GetActivity() == ACT_VM_IDLE_LOWERED ) 
		{
			SendWeaponAnim( ACT_VM_IDLE );
		}
		else if ( HasWeaponIdleTimeElapsed() ) 
		{
			SendWeaponAnim( ACT_VM_IDLE );
		}
	}
}
void CBaseHLCombatWeapon :: WeaponIdle ( void ) { if ( WeaponShouldBeLowered ( ) ) { #if ! defined ( CLIENT_DLL ) CHL2_Player * pPlayer = dynamic_cast < CHL2_Player * > ( GetOwner ( ) ) ; if ( pPlayer ) { pPlayer -> Weapon_Lower ( ) ; } #endif if ( GetActivity ( ) != ACT_VM_IDLE_LOWERED && GetActivity ( ) != ACT_VM_IDLE_TO_LOWERED && GetActivity ( ) != ACT_TRANSITION ) { SendWeaponAnim ( ACT_VM_IDLE_LOWERED ) ; } else if ( HasWeaponIdleTimeElapsed ( ) ) { SendWeaponAnim ( ACT_VM_IDLE_LOWERED ) ; } } else { if ( m_flRaiseTime < gpGlobals -> curtime && GetActivity ( ) == ACT_VM_IDLE_LOWERED ) { SendWeaponAnim ( ACT_VM_IDLE ) ; } else if ( HasWeaponIdleTimeElapsed ( ) ) { SendWeaponAnim ( ACT_VM_IDLE ) ; } } }
Purpose: Allows the weapon to choose proper weapon idle animation
Purpose : Allows the weapon to choose proper weapon idle animation
//See if we should idle high or low // Move to lowered position if we're not there yet // Keep idling low // See if we need to raise immediately