コード例 #1
0
//-----------------------------------------------------------------------------
// Purpose: Passes Touch along to certain named doors.
//-----------------------------------------------------------------------------
void CBaseDoor::ChainTouch( CBaseEntity *pOther )
{
	if ( m_isChaining )
		return;

	CBaseEntity *ent = NULL;
	while ( ( ent = gEntList.FindEntityByName( ent, m_ChainTarget, NULL ) ) != NULL )
	{
		if ( ent == this )
			continue;

		CBaseDoor *door = dynamic_cast< CBaseDoor * >( ent );
		if ( door )
		{
			door->SetChaining( true );
			door->Touch( pOther );
			door->SetChaining( false );
		}
	}
}
コード例 #2
0
//-----------------------------------------------------------------------------
// Purpose: Passes Use along to certain named doors.
//-----------------------------------------------------------------------------
void CBaseDoor::ChainUse( void )
{
	if ( m_isChaining )
		return;

	CBaseEntity *ent = NULL;
	while ( ( ent = gEntList.FindEntityByName( ent, m_ChainTarget, NULL ) ) != NULL )
	{
		if ( ent == this )
			continue;

		CBaseDoor *door = dynamic_cast< CBaseDoor * >( ent );
		if ( door )
		{
			door->SetChaining( true );
			door->Use( m_hActivator, NULL, USE_TOGGLE, 0.0f ); // only the first param is used
			door->SetChaining( false );
		}
	}
}
コード例 #3
0
ファイル: doors.cpp プロジェクト: XashDev/XashXT
void CBaseDoor :: ChainTouch( CBaseEntity *pOther )
{
	// to prevent recursion
	if( m_isChaining ) return;

	CBaseEntity *pEnt = NULL;

	while(( pEnt = UTIL_FindEntityByTargetname( pEnt, STRING( m_iChainTarget ))) != NULL )
	{
		if( pEnt == this ) continue;

		CBaseDoor *pDoor = (CBaseDoor *)pEnt;

		if( pDoor )
		{
			pDoor->SetChaining( true );
			pDoor->Touch( pOther );
			pDoor->SetChaining( false );
		}
	}
}
コード例 #4
0
ファイル: doors.cpp プロジェクト: XashDev/XashXT
void CBaseDoor :: ChainUse( USE_TYPE useType, float value )
{
	// to prevent recursion
	if( m_isChaining ) return;

	CBaseEntity *pEnt = NULL;

	while(( pEnt = UTIL_FindEntityByTargetname( pEnt, STRING( m_iChainTarget ))) != NULL )
	{
		if( pEnt == this ) continue;

		CBaseDoor *pDoor = (CBaseDoor *)pEnt;

		if( pDoor )
		{
			pDoor->SetChaining( true );
			pDoor->Use( m_hActivator, this, useType, value );
			pDoor->SetChaining( false );
		}
	}
}