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.

69 lines
2.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. // $NoKeywords: $
  8. //=============================================================================//
  9. #include "cbase.h"
  10. #include "c_basetempentity.h"
  11. #include "c_te_legacytempents.h"
  12. #include "tier0/vprof.h"
  13. // memdbgon must be the last include file in a .cpp file!!!
  14. #include "tier0/memdbgon.h"
  15. //-----------------------------------------------------------------------------
  16. // Purpose: Kills Player Attachments
  17. //-----------------------------------------------------------------------------
  18. class C_TEKillPlayerAttachments : public C_BaseTempEntity
  19. {
  20. public:
  21. DECLARE_CLASS( C_TEKillPlayerAttachments, C_BaseTempEntity );
  22. DECLARE_CLIENTCLASS();
  23. C_TEKillPlayerAttachments( void );
  24. virtual ~C_TEKillPlayerAttachments( void );
  25. virtual void PostDataUpdate( DataUpdateType_t updateType );
  26. public:
  27. int m_nPlayer;
  28. };
  29. //-----------------------------------------------------------------------------
  30. // Purpose:
  31. //-----------------------------------------------------------------------------
  32. C_TEKillPlayerAttachments::C_TEKillPlayerAttachments( void )
  33. {
  34. m_nPlayer = 0;
  35. }
  36. //-----------------------------------------------------------------------------
  37. // Purpose:
  38. //-----------------------------------------------------------------------------
  39. C_TEKillPlayerAttachments::~C_TEKillPlayerAttachments( void )
  40. {
  41. }
  42. //-----------------------------------------------------------------------------
  43. // Purpose:
  44. // Input : bool -
  45. //-----------------------------------------------------------------------------
  46. void C_TEKillPlayerAttachments::PostDataUpdate( DataUpdateType_t updateType )
  47. {
  48. VPROF( "C_TEKillPlayerAttachments::PostDataUpdate" );
  49. tempents->KillAttachedTents( m_nPlayer );
  50. }
  51. void TE_KillPlayerAttachments( IRecipientFilter& filter, float delay,
  52. int player )
  53. {
  54. tempents->KillAttachedTents( player );
  55. }
  56. IMPLEMENT_CLIENTCLASS_EVENT_DT(C_TEKillPlayerAttachments, DT_TEKillPlayerAttachments, CTEKillPlayerAttachments)
  57. RecvPropInt( RECVINFO(m_nPlayer)),
  58. END_RECV_TABLE()