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.

73 lines
2.1 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_cs_player.h"
  16. #include "radio_status.h"
  17. // NOTE: This has to be the last file included!
  18. #include "tier0/memdbgon.h"
  19. //-----------------------------------------------------------------------------
  20. // Purpose: Kills Player Attachments
  21. //-----------------------------------------------------------------------------
  22. class C_TERadioIcon : public C_BaseTempEntity
  23. {
  24. public:
  25. DECLARE_CLASS( C_TERadioIcon, C_BaseTempEntity );
  26. DECLARE_CLIENTCLASS();
  27. C_TERadioIcon( void );
  28. virtual ~C_TERadioIcon( void );
  29. virtual void PostDataUpdate( DataUpdateType_t updateType );
  30. public:
  31. int m_iAttachToClient;
  32. };
  33. //-----------------------------------------------------------------------------
  34. // Purpose:
  35. //-----------------------------------------------------------------------------
  36. C_TERadioIcon::C_TERadioIcon( void )
  37. {
  38. }
  39. //-----------------------------------------------------------------------------
  40. // Purpose:
  41. //-----------------------------------------------------------------------------
  42. C_TERadioIcon::~C_TERadioIcon( void )
  43. {
  44. }
  45. //-----------------------------------------------------------------------------
  46. // Purpose:
  47. // Input : bool -
  48. //-----------------------------------------------------------------------------
  49. void C_TERadioIcon::PostDataUpdate( DataUpdateType_t updateType )
  50. {
  51. //Flash them on the radar
  52. //this could be in a better place.
  53. C_CSPlayer *pPlayer = static_cast<C_CSPlayer*>( cl_entitylist->GetEnt(m_iAttachToClient) );
  54. if ( pPlayer && !pPlayer->IsDormant() )
  55. {
  56. // Create the flashy above player's head
  57. RadioManager()->UpdateRadioStatus( m_iAttachToClient, 1.5f );
  58. }
  59. }
  60. IMPLEMENT_CLIENTCLASS_EVENT_DT(C_TERadioIcon, DT_TERadioIcon, CTERadioIcon)
  61. RecvPropInt( RECVINFO(m_iAttachToClient)),
  62. END_RECV_TABLE()