summaryrefslogtreecommitdiff
path: root/game/client/cstrike/c_te_radioicon.cpp
blob: c49c11bbd741146ae37ae64b5567db0f8bac966a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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()