Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
805 B

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "fx_impact.h"
  8. void TFCImpact( const CEffectData &data )
  9. {
  10. Vector vOrigin, vStart, vDir;
  11. short nSurfaceProp;
  12. int iMaterial, iDamageType, iHitbox;
  13. C_BaseEntity *pEntity = ParseImpactData( data, &vOrigin, &vStart, &vDir, nSurfaceProp, iMaterial, iDamageType, iHitbox );
  14. trace_t tr;
  15. if ( Impact( vOrigin, vStart, iMaterial, iDamageType, iHitbox, iEntIndex, tr ) )
  16. {
  17. // Check for custom effects based on the Decal index
  18. PerformCustomEffects( vOrigin, tr, vDir, iMaterial, 1.0 );
  19. }
  20. PlayImpactSound( pEntity, tr, vOrigin, nSurfaceProp );
  21. }
  22. DECLARE_CLIENT_EFFECT( "Impact", TFCImpact );