//----------------------------------------------------------------------------- // 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 ); } } }
//----------------------------------------------------------------------------- // 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 ); } } }
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 ); } } }
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 ); } } }