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.

74 lines
2.1 KiB

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