sp/src/game/server/hl2/weapon_sniperrifle.cpp
bool CWeaponSniperRifle::Holster( CBaseCombatWeapon *pSwitchingTo )
{
	CBasePlayer *pPlayer = ToBasePlayer( GetOwner() );
	if (pPlayer != NULL)
	{
		if ( m_nZoomLevel != 0 )
		{
			color32 lightRed = { 255, 50, 50, 32 };

			pPlayer->ShowViewModel(true);
			pPlayer->SetFOV( this, 0, 0.2f );
			m_nZoomLevel = 0;

			UTIL_ScreenFade( pPlayer, lightRed, 0.2f, 0, (FFADE_IN|FFADE_PURGE) );
		}
	}

	return BaseClass::Holster(pSwitchingTo);
}
//-----------------------------------------------------------------------------
// Purpose: Turns off the zoom when the rifle is holstered.
//-----------------------------------------------------------------------------
Turns off the zoom when the rifle is holstered.
Turns off the zoom when the rifle is holstered .
bool CWeaponSniperRifle::Holster( CBaseCombatWeapon *pSwitchingTo )
{
	CBasePlayer *pPlayer = ToBasePlayer( GetOwner() );
	if (pPlayer != NULL)
	{
		if ( m_nZoomLevel != 0 )
		{
			color32 lightRed = { 255, 50, 50, 32 };
			pPlayer->ShowViewModel(true);
			pPlayer->SetFOV( this, 0, 0.2f );
			m_nZoomLevel = 0;
			UTIL_ScreenFade( pPlayer, lightRed, 0.2f, 0, (FFADE_IN|FFADE_PURGE) );
		}
	}
	return BaseClass::Holster(pSwitchingTo);
}
bool CWeaponSniperRifle :: Holster ( CBaseCombatWeapon * pSwitchingTo ) { CBasePlayer * pPlayer = ToBasePlayer ( GetOwner ( ) ) ; if ( pPlayer != NULL ) { if ( m_nZoomLevel != 0 ) { color32 lightRed = { 255 , 50 , 50 , 32 } ; pPlayer -> ShowViewModel ( true ) ; pPlayer -> SetFOV ( this , 0 , 0.2f ) ; m_nZoomLevel = 0 ; UTIL_ScreenFade ( pPlayer , lightRed , 0.2f , 0 , ( FFADE_IN | FFADE_PURGE ) ) ; } } return BaseClass :: Holster ( pSwitchingTo ) ; }
Purpose: Turns off the zoom when the rifle is holstered.
Purpose : Turns off the zoom when the rifle is holstered .