mirror of
https://github.com/nillerusr/source-engine.git
synced 2025-01-03 14:06:44 +00:00
30 lines
805 B
C++
30 lines
805 B
C++
//========= Copyright Valve Corporation, All rights reserved. ============//
|
|
//
|
|
// Purpose:
|
|
//
|
|
//=============================================================================//
|
|
|
|
#include "cbase.h"
|
|
#include "fx_impact.h"
|
|
|
|
|
|
void TFCImpact( const CEffectData &data )
|
|
{
|
|
Vector vOrigin, vStart, vDir;
|
|
short nSurfaceProp;
|
|
int iMaterial, iDamageType, iHitbox;
|
|
C_BaseEntity *pEntity = ParseImpactData( data, &vOrigin, &vStart, &vDir, nSurfaceProp, iMaterial, iDamageType, iHitbox );
|
|
|
|
trace_t tr;
|
|
if ( Impact( vOrigin, vStart, iMaterial, iDamageType, iHitbox, iEntIndex, tr ) )
|
|
{
|
|
// Check for custom effects based on the Decal index
|
|
PerformCustomEffects( vOrigin, tr, vDir, iMaterial, 1.0 );
|
|
}
|
|
|
|
PlayImpactSound( pEntity, tr, vOrigin, nSurfaceProp );
|
|
}
|
|
|
|
|
|
DECLARE_CLIENT_EFFECT( "Impact", TFCImpact );
|