Example #1
0
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void CInfoGameEventProxy::Spawn()
{
	BaseClass::Spawn();

	m_flRange *= 12.0f; // Convert feet to inches

	if( GetSpawnFlags() & SF_GAME_EVENT_PROXY_AUTO_VISIBILITY )
	{
		VisibilityMonitor_AddEntity( this, m_flRange, &CInfoGameEventProxy::GameEventProxyCallback, NULL );
	}

}
void CASW_Barrel_Explosive::Spawn()
{
	DisableAutoFade();
	SetModelName( AllocPooledString( ASW_EXPLOSIVE_BARREL_MODEL_NAME ) );
	Precache();
	SetModel( ASW_EXPLOSIVE_BARREL_MODEL_NAME );

	AddSpawnFlags( SF_PHYSPROP_AIMTARGET );
	BaseClass::Spawn();

	InitHealth();

	VisibilityMonitor_AddEntity( this, asw_visrange_generic.GetFloat() * 0.9f, NULL, NULL );
}
Example #3
0
void CASW_Button_Area::UpdateWaitingForInput()
{
	bool bOldWaitingForInput = m_bWaitingForInput;

	bool bSet = false;

	if ( m_bIsDoorButton )
	{
		CASW_Door *pDoor = GetDoor();
		if ( pDoor && pDoor->IsAutoOpen() )
		{
			m_bWaitingForInput = false;
			bSet = true;
		}
	}

	if ( !bSet )
	{
		m_bWaitingForInput = ASWGameRules()->GetGameState() == ASW_GS_INGAME && 
							 ( !m_bNoPower && !m_bIsInUse && ( m_bIsLocked || ( !m_bWasLocked && m_fLastButtonUseTime == 0 ) ) );
	}

	if ( !bOldWaitingForInput && m_bWaitingForInput )
	{
		VisibilityMonitor_AddEntity( this, asw_visrange_generic.GetFloat() * 0.9f, &CASW_Button_Area::WaitingForInputVismonCallback, &CASW_Button_Area::WaitingForInputVismonEvaluator );
	}
	else if ( bOldWaitingForInput && !m_bWaitingForInput )
	{
		VisibilityMonitor_RemoveEntity( this );

		IGameEvent * event = gameeventmanager->CreateEvent( "button_area_inactive" );
		if ( event )
		{
			event->SetInt( "entindex", entindex() );
			gameeventmanager->FireEvent( event );
		}
	}
}
Example #4
0
void CASW_Ammo::Spawn( void )
{
	BaseClass::Spawn();

	VisibilityMonitor_AddEntity( this, asw_visrange_generic.GetFloat() * 0.9f, &CASW_Ammo::VismonCallback, NULL );
}