add source-sdk-2013

This commit is contained in:
nillerusr
2022-03-01 23:00:42 +03:00
parent 88b8830e8b
commit edc8d6c584
3288 changed files with 3731 additions and 1062455 deletions
+15 -85
View File
@@ -38,8 +38,6 @@
#endif
#include "vprof.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
@@ -90,7 +88,6 @@ CBaseCombatWeapon::CBaseCombatWeapon()
#if !defined( CLIENT_DLL )
m_pConstraint = NULL;
m_bSoundsEnabled = true;
OnBaseCombatWeaponCreated( this );
#endif
@@ -167,20 +164,8 @@ void CBaseCombatWeapon::GiveDefaultAmmo( void )
//-----------------------------------------------------------------------------
void CBaseCombatWeapon::Spawn( void )
{
bool bPrecacheAllowed = CBaseEntity::IsPrecacheAllowed();
if (!bPrecacheAllowed)
{
tmEnter( TELEMETRY_LEVEL1, TMZF_NONE, "LateWeaponPrecache" );
}
Precache();
if (!bPrecacheAllowed)
{
tmLeave( TELEMETRY_LEVEL1 );
}
BaseClass::Spawn();
SetSolid( SOLID_BBOX );
@@ -1094,10 +1079,10 @@ int CBaseCombatWeapon::UpdateClientData( CBasePlayer *pPlayer )
// Purpose:
// Input : index -
//-----------------------------------------------------------------------------
void CBaseCombatWeapon::SetViewModelIndex( int index_ )
void CBaseCombatWeapon::SetViewModelIndex( int index )
{
Assert( index_ >= 0 && index_ < MAX_VIEWMODELS );
m_nViewModelIndex = index_;
Assert( index >= 0 && index < MAX_VIEWMODELS );
m_nViewModelIndex = index;
}
//-----------------------------------------------------------------------------
@@ -1150,7 +1135,7 @@ float CBaseCombatWeapon::GetViewModelSequenceDuration()
return vm->SequenceDuration();
}
bool CBaseCombatWeapon::IsViewModelSequenceFinished( void ) const
bool CBaseCombatWeapon::IsViewModelSequenceFinished( void )
{
// These are not valid activities and always complete immediately
if ( GetActivity() == ACT_RESET || GetActivity() == ACT_INVALID )
@@ -1453,12 +1438,7 @@ selects and deploys each weapon as you pass it. (sjb)
bool CBaseCombatWeapon::Deploy( )
{
MDLCACHE_CRITICAL_SECTION();
bool bResult = DefaultDeploy( (char*)GetViewModel(), (char*)GetWorldModel(), GetDrawActivity(), (char*)GetAnimPrefix() );
// override pose parameters
PoseParameterOverride( false );
return bResult;
return DefaultDeploy( (char*)GetViewModel(), (char*)GetWorldModel(), GetDrawActivity(), (char*)GetAnimPrefix() );
}
Activity CBaseCombatWeapon::GetDrawActivity( void )
@@ -1517,9 +1497,6 @@ bool CBaseCombatWeapon::Holster( CBaseCombatWeapon *pSwitchingTo )
RescindReloadHudHint();
}
// reset pose parameters
PoseParameterOverride( true );
return true;
}
@@ -1666,11 +1643,6 @@ void CBaseCombatWeapon::ItemPreFrame( void )
#endif
}
bool CBaseCombatWeapon::CanPerformSecondaryAttack() const
{
return m_flNextSecondaryAttack <= gpGlobals->curtime;
}
//====================================================================================
// WEAPON BEHAVIOUR
//====================================================================================
@@ -1695,7 +1667,7 @@ void CBaseCombatWeapon::ItemPostFrame( void )
bool bFired = false;
// Secondary attack has priority
if ((pOwner->m_nButtons & IN_ATTACK2) && CanPerformSecondaryAttack() )
if ((pOwner->m_nButtons & IN_ATTACK2) && (m_flNextSecondaryAttack <= gpGlobals->curtime))
{
if (UsesSecondaryAmmo() && pOwner->GetAmmoCount(m_iSecondaryAmmoType)<=0 )
{
@@ -1784,8 +1756,8 @@ void CBaseCombatWeapon::ItemPostFrame( void )
// -----------------------
// Reload pressed / Clip Empty
// Can only start the Reload Cycle after the firing cycle
if ( ( pOwner->m_nButtons & IN_RELOAD ) && m_flNextPrimaryAttack <= gpGlobals->curtime && UsesClipsForAmmo1() && !m_bInReload )
// -----------------------
if ( ( pOwner->m_nButtons & IN_RELOAD ) && UsesClipsForAmmo1() && !m_bInReload )
{
// reload when reload is pressed, or if no buttons are down and weapon is empty.
Reload();
@@ -1886,11 +1858,6 @@ float CBaseCombatWeapon::GetFireRate( void )
//-----------------------------------------------------------------------------
void CBaseCombatWeapon::WeaponSound( WeaponSound_t sound_type, float soundtime /* = 0.0f */ )
{
#if !defined( CLIENT_DLL )
if ( !m_bSoundsEnabled )
return;
#endif
// If we have some sounds from the weapon classname.txt file, play a random one of them
const char *shootsound = GetShootSound( sound_type );
if ( !shootsound || !shootsound[0] )
@@ -2454,53 +2421,23 @@ bool CBaseCombatWeapon::IsLocked( CBaseEntity *pAsker )
//-----------------------------------------------------------------------------
Activity CBaseCombatWeapon::ActivityOverride( Activity baseAct, bool *pRequired )
{
int actCount = 0;
acttable_t *pTable = ActivityList( actCount );
acttable_t *pTable = ActivityList();
int actCount = ActivityListCount();
for ( int i = 0; i < actCount; i++ )
for ( int i = 0; i < actCount; i++, pTable++ )
{
const acttable_t& act = pTable[i];
if ( baseAct == act.baseAct )
if ( baseAct == pTable->baseAct )
{
if (pRequired)
{
*pRequired = act.required;
*pRequired = pTable->required;
}
return (Activity)act.weaponAct;
return (Activity)pTable->weaponAct;
}
}
return baseAct;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CBaseCombatWeapon::PoseParameterOverride( bool bReset )
{
CBaseCombatCharacter *pOwner = GetOwner();
if ( !pOwner )
return;
CStudioHdr *pStudioHdr = pOwner->GetModelPtr();
if ( !pStudioHdr )
return;
int iCount = 0;
poseparamtable_t *pPoseParamList = PoseParamList( iCount );
if ( pPoseParamList )
{
for ( int i=0; i<iCount; ++i )
{
int iPoseParam = pOwner->LookupPoseParameter( pStudioHdr, pPoseParamList[i].pszName );
if ( iPoseParam != -1 )
pOwner->SetPoseParameter( iPoseParam, bReset ? 0 : pPoseParamList[i].flValue );
}
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
@@ -2789,13 +2726,6 @@ void* SendProxy_SendNonLocalWeaponDataTable( const SendProp *pProp, const void *
}
REGISTER_SEND_PROXY_NON_MODIFIED_POINTER( SendProxy_SendNonLocalWeaponDataTable );
#else
void CBaseCombatWeapon::RecvProxy_WeaponState( const CRecvProxyData *pData, void *pStruct, void *pOut )
{
CBaseCombatWeapon *pWeapon = (CBaseCombatWeapon*)pStruct;
pWeapon->m_iState = pData->m_Value.m_Int;
pWeapon->UpdateVisibility();
}
#endif
#if PREDICTION_ERROR_CHECK_LEVEL > 1
@@ -2869,7 +2799,7 @@ BEGIN_NETWORK_TABLE(CBaseCombatWeapon, DT_BaseCombatWeapon)
RecvPropDataTable("LocalActiveWeaponData", 0, 0, &REFERENCE_RECV_TABLE(DT_LocalActiveWeaponData)),
RecvPropInt( RECVINFO(m_iViewModelIndex)),
RecvPropInt( RECVINFO(m_iWorldModelIndex)),
RecvPropInt( RECVINFO(m_iState), 0, &CBaseCombatWeapon::RecvProxy_WeaponState ),
RecvPropInt( RECVINFO(m_iState )),
RecvPropEHandle( RECVINFO(m_hOwner ) ),
#endif
END_NETWORK_TABLE()