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.

59 lines
1.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "fx.h"
  8. #include "c_te_effect_dispatch.h"
  9. #include "c_te_legacytempents.h"
  10. // memdbgon must be the last include file in a .cpp file!!!
  11. #include "tier0/memdbgon.h"
  12. //-----------------------------------------------------------------------------
  13. // Purpose:
  14. //-----------------------------------------------------------------------------
  15. void ShellEjectCallback( const CEffectData &data )
  16. {
  17. // Use the gun angles to orient the shell
  18. IClientRenderable *pRenderable = data.GetRenderable();
  19. if ( pRenderable )
  20. {
  21. tempents->EjectBrass( data.m_vOrigin, data.m_vAngles, pRenderable->GetRenderAngles(), 0 );
  22. }
  23. }
  24. DECLARE_CLIENT_EFFECT( "ShellEject", ShellEjectCallback );
  25. //-----------------------------------------------------------------------------
  26. // Purpose:
  27. //-----------------------------------------------------------------------------
  28. void RifleShellEjectCallback( const CEffectData &data )
  29. {
  30. // Use the gun angles to orient the shell
  31. IClientRenderable *pRenderable = data.GetRenderable();
  32. if ( pRenderable )
  33. {
  34. tempents->EjectBrass( data.m_vOrigin, data.m_vAngles, pRenderable->GetRenderAngles(), 1 );
  35. }
  36. }
  37. DECLARE_CLIENT_EFFECT( "RifleShellEject", RifleShellEjectCallback );
  38. //-----------------------------------------------------------------------------
  39. // Purpose:
  40. //-----------------------------------------------------------------------------
  41. void ShotgunShellEjectCallback( const CEffectData &data )
  42. {
  43. // Use the gun angles to orient the shell
  44. IClientRenderable *pRenderable = data.GetRenderable();
  45. if ( pRenderable )
  46. {
  47. tempents->EjectBrass( data.m_vOrigin, data.m_vAngles, pRenderable->GetRenderAngles(), 2 );
  48. }
  49. }
  50. DECLARE_CLIENT_EFFECT( "ShotgunShellEject", ShotgunShellEjectCallback );