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.

52 lines
1.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Dynamic light at the end of a spotlight
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. // $NoKeywords: $
  8. //=============================================================================//
  9. #include "cbase.h"
  10. #include "spotlightend.h"
  11. // memdbgon must be the last include file in a .cpp file!!!
  12. #include "tier0/memdbgon.h"
  13. LINK_ENTITY_TO_CLASS(spotlight_end, CSpotlightEnd);
  14. IMPLEMENT_SERVERCLASS_ST(CSpotlightEnd, DT_SpotlightEnd)
  15. SendPropFloat(SENDINFO(m_flLightScale), 0, SPROP_NOSCALE),
  16. SendPropFloat(SENDINFO(m_Radius), 0, SPROP_NOSCALE),
  17. // SendPropVector(SENDINFO(m_vSpotlightDir), -1, SPROP_NORMAL),
  18. // SendPropVector(SENDINFO(m_vSpotlightOrg), -1, SPROP_COORD),
  19. END_SEND_TABLE()
  20. //---------------------------------------------------------
  21. // Save/Restore
  22. //---------------------------------------------------------
  23. BEGIN_DATADESC( CSpotlightEnd )
  24. DEFINE_FIELD( m_flLightScale, FIELD_FLOAT ),
  25. DEFINE_FIELD( m_Radius, FIELD_FLOAT ),
  26. DEFINE_FIELD( m_vSpotlightDir, FIELD_VECTOR ),
  27. DEFINE_FIELD( m_vSpotlightOrg, FIELD_POSITION_VECTOR ),
  28. END_DATADESC()
  29. //------------------------------------------------------------------------------
  30. // Purpose :
  31. // Input :
  32. // Output :
  33. //------------------------------------------------------------------------------
  34. void CSpotlightEnd::Spawn( void )
  35. {
  36. Precache();
  37. m_flLightScale = 100;
  38. SetSolid( SOLID_NONE );
  39. SetMoveType( MOVETYPE_FLY );
  40. UTIL_SetSize( this, vec3_origin, vec3_origin );
  41. AddEFlags( EFL_FORCE_CHECK_TRANSMIT );
  42. }