source-engine/game/shared/tf2base/tf_weapon_revolver.cpp
2022-08-13 03:20:41 +03:00

61 lines
1.4 KiB
C++

//====== Copyright © 1996-2005, Valve Corporation, All rights reserved. =======
//
//
//=============================================================================
#include "cbase.h"
#include "tf_weapon_revolver.h"
#include "tf_fx_shared.h"
// Client specific.
#ifdef CLIENT_DLL
#include "c_tf_player.h"
// Server specific.
#else
#include "tf_player.h"
#endif
//=============================================================================
//
// Weapon Revolver tables.
//
IMPLEMENT_NETWORKCLASS_ALIASED( TFRevolver, DT_WeaponRevolver )
BEGIN_NETWORK_TABLE( CTFRevolver, DT_WeaponRevolver )
END_NETWORK_TABLE()
BEGIN_PREDICTION_DATA( CTFRevolver )
END_PREDICTION_DATA()
LINK_ENTITY_TO_CLASS( tf_weapon_revolver, CTFRevolver );
PRECACHE_WEAPON_REGISTER( tf_weapon_revolver );
// Server specific.
#ifndef CLIENT_DLL
BEGIN_DATADESC( CTFRevolver )
END_DATADESC()
#endif
//=============================================================================
//
// Weapon Revolver functions.
//
bool CTFRevolver::DefaultReload( int iClipSize1, int iClipSize2, int iActivity )
{
// The the owning local player.
CTFPlayer *pPlayer = GetTFPlayerOwner();
if ( !pPlayer )
return false;
if ( pPlayer->IsPlayerClass( TF_CLASS_SPY ) )
{
if ( pPlayer->m_Shared.InCond( TF_COND_STEALTHED ) )
{
return false;
}
}
return BaseClass::DefaultReload( iClipSize1, iClipSize2, iActivity );
}