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.

58 lines
1.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Drops particles where the entity was.
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "entityparticletrail_shared.h"
  8. // memdbgon must be the last include file in a .cpp file!!!
  9. #include "tier0/memdbgon.h"
  10. //-----------------------------------------------------------------------------
  11. // Default values
  12. //-----------------------------------------------------------------------------
  13. EntityParticleTrailInfo_t::EntityParticleTrailInfo_t()
  14. {
  15. m_strMaterialName = NULL_STRING;
  16. m_flLifetime = 4.0f;
  17. m_flStartSize = 2.0f;
  18. m_flEndSize = 3.0f;
  19. }
  20. //-----------------------------------------------------------------------------
  21. // Save/load
  22. //-----------------------------------------------------------------------------
  23. #ifndef CLIENT_DLL
  24. BEGIN_SIMPLE_DATADESC( EntityParticleTrailInfo_t )
  25. DEFINE_KEYFIELD( m_strMaterialName, FIELD_STRING, "ParticleTrailMaterial" ),
  26. DEFINE_KEYFIELD( m_flLifetime, FIELD_FLOAT, "ParticleTrailLifetime" ),
  27. DEFINE_KEYFIELD( m_flStartSize, FIELD_FLOAT, "ParticleTrailStartSize" ),
  28. DEFINE_KEYFIELD( m_flEndSize, FIELD_FLOAT, "ParticleTrailEndSize" ),
  29. END_DATADESC()
  30. #endif
  31. //-----------------------------------------------------------------------------
  32. // Networking
  33. //-----------------------------------------------------------------------------
  34. BEGIN_NETWORK_TABLE_NOBASE( EntityParticleTrailInfo_t, DT_EntityParticleTrailInfo )
  35. #ifdef CLIENT_DLL
  36. RecvPropFloat( RECVINFO( m_flLifetime ) ),
  37. RecvPropFloat( RECVINFO( m_flStartSize ) ),
  38. RecvPropFloat( RECVINFO( m_flEndSize ) ),
  39. #else
  40. SendPropFloat( SENDINFO( m_flLifetime ), 0, SPROP_NOSCALE ),
  41. SendPropFloat( SENDINFO( m_flStartSize ), 0, SPROP_NOSCALE ),
  42. SendPropFloat( SENDINFO( m_flEndSize ), 0, SPROP_NOSCALE ),
  43. #endif
  44. END_NETWORK_TABLE()