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.

78 lines
2.5 KiB

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #include "cbase.h"
  7. #include "c_basetempentity.h"
  8. #include "c_te_legacytempents.h"
  9. #include "tier0/vprof.h"
  10. // memdbgon must be the last include file in a .cpp file!!!
  11. #include "tier0/memdbgon.h"
  12. //-----------------------------------------------------------------------------
  13. // Purpose: Client Projectile TE
  14. //-----------------------------------------------------------------------------
  15. class C_TEClientProjectile : public C_BaseTempEntity
  16. {
  17. public:
  18. DECLARE_CLASS( C_TEClientProjectile, C_BaseTempEntity );
  19. DECLARE_CLIENTCLASS();
  20. C_TEClientProjectile( void );
  21. virtual ~C_TEClientProjectile( void );
  22. virtual void PostDataUpdate( DataUpdateType_t updateType );
  23. public:
  24. Vector m_vecOrigin;
  25. Vector m_vecVelocity;
  26. int m_nModelIndex;
  27. int m_nLifeTime;
  28. EHANDLE m_hOwner;
  29. };
  30. //-----------------------------------------------------------------------------
  31. // Purpose:
  32. //-----------------------------------------------------------------------------
  33. C_TEClientProjectile::C_TEClientProjectile( void )
  34. {
  35. m_vecOrigin.Init();
  36. m_vecVelocity.Init();
  37. m_nModelIndex = 0;
  38. m_nLifeTime = 0;
  39. m_hOwner = NULL;
  40. }
  41. //-----------------------------------------------------------------------------
  42. // Purpose:
  43. //-----------------------------------------------------------------------------
  44. C_TEClientProjectile::~C_TEClientProjectile( void )
  45. {
  46. }
  47. void TE_ClientProjectile( IRecipientFilter& filter, float delay,
  48. const Vector* vecOrigin, const Vector* vecVelocity, int modelindex, int lifetime, CBaseEntity *pOwner )
  49. {
  50. tempents->ClientProjectile( *vecOrigin, *vecVelocity, vec3_origin, modelindex, lifetime, pOwner );
  51. }
  52. //-----------------------------------------------------------------------------
  53. // Purpose:
  54. // Input : bool -
  55. //-----------------------------------------------------------------------------
  56. void C_TEClientProjectile::PostDataUpdate( DataUpdateType_t updateType )
  57. {
  58. VPROF( "C_TEClientProjectile::PostDataUpdate" );
  59. tempents->ClientProjectile( m_vecOrigin, m_vecVelocity, vec3_origin, m_nModelIndex, m_nLifeTime, m_hOwner );
  60. }
  61. IMPLEMENT_CLIENTCLASS_EVENT_DT(C_TEClientProjectile, DT_TEClientProjectile, CTEClientProjectile)
  62. RecvPropVector( RECVINFO(m_vecOrigin)),
  63. RecvPropVector( RECVINFO(m_vecVelocity)),
  64. RecvPropInt( RECVINFO(m_nModelIndex)),
  65. RecvPropInt( RECVINFO(m_nLifeTime)),
  66. RecvPropEHandle( RECVINFO(m_hOwner)),
  67. END_RECV_TABLE()