diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/tf2/c_controlzone.cpp | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/tf2/c_controlzone.cpp')
| -rw-r--r-- | game/client/tf2/c_controlzone.cpp | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/game/client/tf2/c_controlzone.cpp b/game/client/tf2/c_controlzone.cpp new file mode 100644 index 0000000..be220b4 --- /dev/null +++ b/game/client/tf2/c_controlzone.cpp @@ -0,0 +1,67 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $Workfile: $ +// $Date: $ +// +//----------------------------------------------------------------------------- +// $Log: $ +// +// $NoKeywords: $ +//=============================================================================// +#include "cbase.h" +#include "c_controlzone.h" +#include "mapdata.h" + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +C_ControlZone::C_ControlZone() +{ + m_nZoneNumber = 0; + + m_pShowTriggers = cvar->FindVar("showtriggers"); +} + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +C_ControlZone::~C_ControlZone() +{ +} + +//----------------------------------------------------------------------------- +// Purpose: Are we using showtriggers? +// Output : Returns true on success, false on failure. +//----------------------------------------------------------------------------- +bool C_ControlZone::ShouldDraw() +{ + if ( !m_pShowTriggers ) + return false; + + return m_pShowTriggers->GetInt() != 0 ? true : false; +} + +//----------------------------------------------------------------------------- +// Purpose: Update global map state based on data received +// Input : bnewentity - +//----------------------------------------------------------------------------- +void C_ControlZone::OnDataChanged( DataUpdateType_t updateType ) +{ + BaseClass::OnDataChanged( updateType ); + + CMapZones *zone; + if ( m_nZoneNumber < 1 || + m_nZoneNumber > MAX_ZONES ) + return; + + zone = &MapData().m_Zones[ m_nZoneNumber -1 ]; + zone->m_nControllingTeam = GetTeamNumber(); +} + +IMPLEMENT_CLIENTCLASS_DT(C_ControlZone, DT_ControlZone, CControlZone) + RecvPropInt( RECVINFO(m_nZoneNumber )), +END_RECV_TABLE() + + |