void AddHoloObjective( CPointHoloObjective *pEntity )
{
	Assert( !g_HoloObjectives.HasElement( pEntity ) );
	if ( !g_HoloObjectives.HasElement( pEntity ) )
	{
		g_HoloObjectives.AddToTail( pEntity );
	}
}
void CBaseContainerNode::SelectAllInBounds( bool bSelected, CUtlVector<CBaseNode*> *hNodes )
{
	CUtlVector<CBaseNode*> local;
	CUtlVector<CBaseNode*> *nodes = hNodes ? hNodes : &local;

	Assert( nodes );

	int numNodes = pNodeView->GetNumNodes();
	for ( int i = 0; i < numNodes; i++ )
	{
		CBaseNode *n = pNodeView->GetNode( i );
		if ( n == this )
			continue;
		Vector2D nodePos = n->GetContainerSensitiveCenter();

		bool bIsActive = IsInContainerBounds( nodePos );
		if ( !bIsActive )
			continue;

		if ( nodes->HasElement( n ) )
			continue;

		nodes->AddToTail( n );
		n->SetSelected( bSelected );
		if ( n->GetAsContainer() != NULL )
			n->GetAsContainer()->SelectAllInBounds( bSelected, nodes );
	}
}
void RemoveHoloObjective( CPointHoloObjective *pEntity )
{
	if ( g_HoloObjectives.HasElement( pEntity ) )
	{
		g_HoloObjectives.FindAndRemove( pEntity );
	}
}
예제 #4
0
//-----------------------------------------------------------------------------
// Purpose: checks all posted animation events, firing if time
//-----------------------------------------------------------------------------
void AnimationController::UpdatePostedMessages(bool bRunToCompletion)
{
	CUtlVector<RanEvent_t> eventsRanThisFrame;

	// check all posted messages
	for (int i = 0; i < m_PostedMessages.Count(); i++)
	{
		PostedMessage_t &msgRef = m_PostedMessages[i];
		if (m_flCurrentTime < msgRef.startTime && !bRunToCompletion)
			continue;

		// take a copy of th message
		PostedMessage_t msg = msgRef;

		// remove the event
		// do this before handling the message because the message queue may be messed with
		m_PostedMessages.Remove(i);
		// reset the count, start the whole queue again
		i = -1;

		// handle the event
		switch (msg.commandType)
		{
		case CMD_RUNEVENT:
			{
				RanEvent_t curEvent;
				curEvent.event = msg.event;
				curEvent.pParent = msg.parent.Get();

				// run the event, but only if we haven't already run it this frame, for this parent
				if (!eventsRanThisFrame.HasElement(curEvent))
				{
					eventsRanThisFrame.AddToTail(curEvent);
					RunCmd_RunEvent(msg);
				}
			}	
			break;
		case CMD_STOPEVENT:
			RunCmd_StopEvent(msg);
			break;
		case CMD_STOPPANELANIMATIONS:
			RunCmd_StopPanelAnimations(msg);
			break;
		case CMD_STOPANIMATION:
			RunCmd_StopAnimation(msg);
			break;
		case CMD_SETFONT:
			RunCmd_SetFont(msg);
			break;
		case CMD_SETTEXTURE:
			RunCmd_SetTexture(msg);
			break;
		case CMD_SETSTRING:
			RunCmd_SetString( msg );
			break;
		}
	}
}
예제 #5
0
// look for dead/spectating players in our volume, to call touch on
void CTriggerSoundscape::PlayerUpdateThink()
{
	int i;
	SetNextThink( gpGlobals->curtime + 0.2 );

	CUtlVector<CBasePlayerHandle> oldSpectators;
	oldSpectators = m_spectators;
	m_spectators.RemoveAll();

	for ( i=1; i <= gpGlobals->maxClients; ++i )
	{
		CBasePlayer *player = UTIL_PlayerByIndex( i );

		if ( !player )
			continue;

		if ( player->IsAlive() )
			continue;

		// if the spectator is intersecting the trigger, track it, and start a touch if it is just starting to touch
		if ( Intersects( player ) )
		{
			if ( !oldSpectators.HasElement( player ) )
			{
				StartTouch( player );
			}
			m_spectators.AddToTail( player );
		}
	}

	// check for spectators who are no longer intersecting
	for ( i=0; i<oldSpectators.Count(); ++i )
	{
		CBasePlayer *player = oldSpectators[i];

		if ( !player )
			continue;

		if ( !m_spectators.HasElement( player ) )
		{
			EndTouch( player );
		}
	}
}
CDeferredLightContainer::~CDeferredLightContainer()
{
	Assert( __g_pLightContainerDict.HasElement( this ) );
	__g_pLightContainerDict.FindAndRemove( this );

#ifdef CLIENT_DLL
	Assert( m_iSanityCounter == 0 );
	Assert( m_hLights.Count() == 0 );
#endif
}