//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CTeamControlPoint::InputSetLocked( inputdata_t &inputdata ) { // never lock/unlock the point if we're in waiting for players if ( TeamplayRoundBasedRules() && TeamplayRoundBasedRules()->IsInWaitingForPlayers() ) return; bool bLocked = inputdata.value.Int() > 0; InternalSetLocked( bLocked ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CTeamControlPoint::UnlockThink( void ) { if ( m_flUnlockTime > 0 && m_flUnlockTime < gpGlobals->curtime && ( TeamplayRoundBasedRules() && TeamplayRoundBasedRules()->State_Get() == GR_STATE_RND_RUNNING ) ) { InternalSetLocked( false ); return; } SetContextThink( &CTeamControlPoint::UnlockThink, gpGlobals->curtime + 0.1, CONTROL_POINT_UNLOCK_THINK ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CTeamControlPoint::InputRoundActivate( inputdata_t &inputdata ) { switch ( m_iTeam - FIRST_GAME_TEAM+1 ) { case 1: m_OnRoundStartOwnedByTeam1.FireOutput( this, this ); break; case 2: m_OnRoundStartOwnedByTeam2.FireOutput( this, this ); break; } InternalSetLocked( m_bLocked ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CTeamControlPoint::InputRoundActivate( inputdata_t &inputdata ) { switch ( m_iTeam - FIRST_GAME_TEAM+1 ) { case 1: m_OnRoundStartOwnedByTeam1.FireOutput( this, this ); break; case 2: m_OnRoundStartOwnedByTeam2.FireOutput( this, this ); break; #if defined ( TF_CLASSIC ) case 3: m_OnRoundStartOwnedByTeam3.FireOutput( this, this ); break; case 4: m_OnRoundStartOwnedByTeam4.FireOutput( this, this ); break; #endif } InternalSetLocked( m_bLocked ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CTeamControlPoint::InputSetUnlockTime( inputdata_t &inputdata ) { // never lock/unlock the point if we're in waiting for players if ( TeamplayRoundBasedRules() && TeamplayRoundBasedRules()->IsInWaitingForPlayers() ) return; int nTime = inputdata.value.Int(); if ( nTime <= 0 ) { InternalSetLocked( false ); return; } m_flUnlockTime = gpGlobals->curtime + nTime; if ( ObjectiveResource() ) { ObjectiveResource()->SetCPUnlockTime( GetPointIndex(), m_flUnlockTime ); } SetContextThink( &CTeamControlPoint::UnlockThink, gpGlobals->curtime + 0.1, CONTROL_POINT_UNLOCK_THINK ); }