summaryrefslogtreecommitdiff
path: root/game/client/tfc/fx_tfc_impacts.cpp
blob: 915f4dd574e5700348f7e72fada33ff8a9d78db6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//========= 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 );