summaryrefslogtreecommitdiff
path: root/game/client/cstrike/c_te_radioicon.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/cstrike/c_te_radioicon.cpp
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/client/cstrike/c_te_radioicon.cpp')
-rw-r--r--game/client/cstrike/c_te_radioicon.cpp74
1 files changed, 74 insertions, 0 deletions
diff --git a/game/client/cstrike/c_te_radioicon.cpp b/game/client/cstrike/c_te_radioicon.cpp
new file mode 100644
index 0000000..c49c11b
--- /dev/null
+++ b/game/client/cstrike/c_te_radioicon.cpp
@@ -0,0 +1,74 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $Workfile: $
+// $Date: $
+//
+//-----------------------------------------------------------------------------
+// $Log: $
+//
+// $NoKeywords: $
+//=============================================================================//
+#include "cbase.h"
+#include "c_basetempentity.h"
+#include "c_cs_player.h"
+#include "hud_radar.h"
+#include "radio_status.h"
+
+
+
+//-----------------------------------------------------------------------------
+// Purpose: Kills Player Attachments
+//-----------------------------------------------------------------------------
+class C_TERadioIcon : public C_BaseTempEntity
+{
+public:
+ DECLARE_CLASS( C_TERadioIcon, C_BaseTempEntity );
+ DECLARE_CLIENTCLASS();
+
+ C_TERadioIcon( void );
+ virtual ~C_TERadioIcon( void );
+
+ virtual void PostDataUpdate( DataUpdateType_t updateType );
+
+public:
+ int m_iAttachToClient;
+};
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
+C_TERadioIcon::C_TERadioIcon( void )
+{
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
+C_TERadioIcon::~C_TERadioIcon( void )
+{
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Input : bool -
+//-----------------------------------------------------------------------------
+void C_TERadioIcon::PostDataUpdate( DataUpdateType_t updateType )
+{
+ //Flash them on the radar
+ //this could be in a better place.
+ C_CSPlayer *pPlayer = static_cast<C_CSPlayer*>( cl_entitylist->GetEnt(m_iAttachToClient) );
+
+ if ( pPlayer && !pPlayer->IsDormant() )
+ {
+ // Create the flashy above player's head
+ RadioManager()->UpdateRadioStatus( m_iAttachToClient, 1.5f );
+ }
+
+ Radar_FlashPlayer( m_iAttachToClient );
+}
+
+IMPLEMENT_CLIENTCLASS_EVENT_DT(C_TERadioIcon, DT_TERadioIcon, CTERadioIcon)
+ RecvPropInt( RECVINFO(m_iAttachToClient)),
+END_RECV_TABLE()