Counter Strike : Global Offensive Source Code
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.

92 lines
2.4 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //-----------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #include "cbase.h"
  14. #include "c_basetempentity.h"
  15. #include "c_te_legacytempents.h"
  16. #include "tier0/vprof.h"
  17. // memdbgon must be the last include file in a .cpp file!!!
  18. #include "tier0/memdbgon.h"
  19. //-----------------------------------------------------------------------------
  20. // Purpose: Fizz TE
  21. //-----------------------------------------------------------------------------
  22. class C_TEFizz : public C_BaseTempEntity
  23. {
  24. public:
  25. DECLARE_CLASS( C_TEFizz, C_BaseTempEntity );
  26. DECLARE_CLIENTCLASS();
  27. C_TEFizz( void );
  28. virtual ~C_TEFizz( void );
  29. virtual void PostDataUpdate( DataUpdateType_t updateType );
  30. public:
  31. int m_nEntity;
  32. int m_nModelIndex;
  33. int m_nDensity;
  34. int m_nCurrent;
  35. };
  36. //-----------------------------------------------------------------------------
  37. // Purpose:
  38. //-----------------------------------------------------------------------------
  39. C_TEFizz::C_TEFizz( void )
  40. {
  41. m_nEntity = 0;
  42. m_nModelIndex = 0;
  43. m_nDensity = 0;
  44. m_nCurrent = 0;
  45. }
  46. //-----------------------------------------------------------------------------
  47. // Purpose:
  48. //-----------------------------------------------------------------------------
  49. C_TEFizz::~C_TEFizz( void )
  50. {
  51. }
  52. //-----------------------------------------------------------------------------
  53. // Purpose:
  54. // Input : bool -
  55. //-----------------------------------------------------------------------------
  56. void C_TEFizz::PostDataUpdate( DataUpdateType_t updateType )
  57. {
  58. VPROF( "C_TEFizz::PostDataUpdate" );
  59. C_BaseEntity *pEnt = cl_entitylist->GetEnt( m_nEntity );
  60. if (pEnt != NULL)
  61. {
  62. tempents->FizzEffect(pEnt, m_nModelIndex, m_nDensity, m_nCurrent );
  63. }
  64. }
  65. void TE_Fizz( IRecipientFilter& filter, float delay,
  66. const C_BaseEntity *ed, int modelindex, int density, int current )
  67. {
  68. C_BaseEntity *pEnt = (C_BaseEntity *)ed;
  69. if (pEnt != NULL)
  70. {
  71. tempents->FizzEffect(pEnt, modelindex, density, current );
  72. }
  73. }
  74. IMPLEMENT_CLIENTCLASS_EVENT_DT(C_TEFizz, DT_TEFizz, CTEFizz)
  75. RecvPropInt( RECVINFO(m_nEntity)),
  76. RecvPropInt( RECVINFO(m_nModelIndex)),
  77. RecvPropInt( RECVINFO(m_nDensity)),
  78. RecvPropInt( RECVINFO(m_nCurrent)),
  79. END_RECV_TABLE()