当前位置: 首页>>代码示例>>C++>>正文


C++ CClientPed::SetCurrentContactEntity方法代码示例

本文整理汇总了C++中CClientPed::SetCurrentContactEntity方法的典型用法代码示例。如果您正苦于以下问题:C++ CClientPed::SetCurrentContactEntity方法的具体用法?C++ CClientPed::SetCurrentContactEntity怎么用?C++ CClientPed::SetCurrentContactEntity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CClientPed的用法示例。


在下文中一共展示了CClientPed::SetCurrentContactEntity方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: while

CClientEntity::~CClientEntity()
{
    // Remove collision properties
    while ( !m_notCollidableWith.empty() )
        SetCollidableWith( m_notCollidableWith.front(), true );

    // Reset our index in the element array
    if ( m_ID != INVALID_ELEMENT_ID )
    {
        CElementIDs::SetElement ( m_ID, NULL );

        // Got a clientside ID? Push it back on our stack so we don't run out of client id's
        if ( IsLocalEntity () )
        {
            CElementIDs::PushClientID ( m_ID );
        }
    }

    if ( m_pAttachedToEntity )
    {
        m_pAttachedToEntity->RemoveAttachedEntity ( this );
    }

    for ( attachments_t::iterator iter = m_AttachedEntities.begin() ; iter != m_AttachedEntities.end(); ++iter )
    {
        CClientEntity* pAttachedEntity = *iter;
        if ( pAttachedEntity )
        {
            pAttachedEntity->m_pAttachedToEntity = NULL;
        }
    }

    RemoveAllCollisions ( true );

    if ( m_pEventManager )
    {
        delete m_pEventManager;
        m_pEventManager = NULL;
    }

    if ( m_pElementGroup )
    {
        m_pElementGroup->Remove ( this );
    }

    list < CClientPed* > ::iterator iterUsers = m_OriginSourceUsers.begin ();
    for ( ; iterUsers != m_OriginSourceUsers.end () ; iterUsers++ )
    {
        CClientPed* pModel = *iterUsers;
        if ( pModel->m_interp.pTargetOriginSource == this )
        {
            pModel->m_interp.pTargetOriginSource = NULL;
            pModel->m_interp.bHadOriginSource = true;
        }
    }
    m_OriginSourceUsers.clear ();

    // Unlink our contacts
    list < CClientPed * > ::iterator iterContacts = m_Contacts.begin ();
    for ( ; iterContacts != m_Contacts.end () ; iterContacts++ )
    {
        CClientPed * pModel = *iterContacts;
        if ( pModel->GetCurrentContactEntity () == this )
        {
            pModel->SetCurrentContactEntity ( NULL );
        }
    }
    m_Contacts.clear ();

    // Remove from spatial database
    if ( !g_pClientGame->IsBeingDeleted () )
        GetClientSpatialDatabase ()->RemoveEntity ( this );

    // Ensure intrusive list nodes have been isolated
    assert ( m_FromRootNode.m_pOuterItem == this && !m_FromRootNode.m_pPrev && !m_FromRootNode.m_pNext );

    if ( !g_pClientGame->IsBeingDeleted () )
        CClientEntityRefManager::OnEntityDelete ( this );
}
开发者ID:qaisjp,项目名称:green-candy,代码行数:79,代码来源:CClientEntity.cpp

示例2: ClearChildren

CClientEntity::~CClientEntity ( void )
{
    #ifdef MTA_DEBUG
        --iCount;
    #endif

    // Make sure we won't get deleted later by the element deleter if we've been requested so
    if ( m_bBeingDeleted )
    {
        g_pClientGame->GetElementDeleter ()->Unreference ( this );
    }

    // Remove from parent
    ClearChildren ();
    SetParent ( NULL );

    // Reset our index in the element array
    if ( m_ID != INVALID_ELEMENT_ID )
    {
        CElementIDs::SetElement ( m_ID, NULL );

        // Got a clientside ID? Push it back on our stack so we don't run out of client id's
        if ( IsLocalEntity () )
        {
            CElementIDs::PushClientID ( m_ID );
        }
    }

    // Remove our custom data
    if ( m_pCustomData )
    {
        delete m_pCustomData;
    }

    if ( m_pAttachedToEntity )
    {
        m_pAttachedToEntity->RemoveAttachedEntity ( this );
    }

    for ( list < CClientEntity* >::iterator iter = m_AttachedEntities.begin () ; iter != m_AttachedEntities.end () ; ++iter )
    {
        CClientEntity* pAttachedEntity = *iter;
        if ( pAttachedEntity )
        {
            pAttachedEntity->m_pAttachedToEntity = NULL;
        }
    }

    RemoveAllCollisions ( true );

    if ( m_pEventManager )
    {
        delete m_pEventManager;
        m_pEventManager = NULL;
    }

    if ( m_pElementGroup )
    {
        m_pElementGroup->Remove ( this );
    }

    if ( m_OriginSourceUsers.size () > 0 )
    {
        list < CClientPed* > ::iterator iterUsers = m_OriginSourceUsers.begin ();
        for ( ; iterUsers != m_OriginSourceUsers.end () ; iterUsers++ )
        {
            CClientPed* pModel = *iterUsers;
            if ( pModel->m_interp.pTargetOriginSource == this )
            {
                pModel->m_interp.pTargetOriginSource = NULL;
                pModel->m_interp.bHadOriginSource = true;
            }
        }
        m_OriginSourceUsers.clear ();
    }

    // Unlink our contacts
    list < CClientPed * > ::iterator iterContacts = m_Contacts.begin ();
    for ( ; iterContacts != m_Contacts.end () ; iterContacts++ )
    {
        CClientPed * pModel = *iterContacts;
        if ( pModel->GetCurrentContactEntity () == this )
        {
            pModel->SetCurrentContactEntity ( NULL );
        }
    }
    m_Contacts.clear ();

    // Unlink disabled-collisions
    while ( !m_DisabledCollisions.empty () )
    {
        CClientEntity * pEntity = m_DisabledCollisions.begin ()->first;
        SetCollidableWith ( pEntity, true );
    }

    // Ensure not referenced in the disabled collisions list
    assert ( !MapContains ( g_pClientGame->m_AllDisabledCollisions, this ) );

    // Ensure nothing has inadvertently set a parent
    assert ( m_pParent == NULL );
//.........这里部分代码省略.........
开发者ID:AdiBoy,项目名称:multitheftauto,代码行数:101,代码来源:CClientEntity.cpp

示例3: ClearChildren

CClientEntity::~CClientEntity ( void )
{
    // Make sure we won't get deleted later by the element deleter if we've been requested so
    if ( m_bBeingDeleted )
    {
        g_pClientGame->GetElementDeleter ()->Unreference ( this );
    }

    // Remove from parent
    ClearChildren ();
    SetParent ( NULL );

    // Reset our index in the element array
    if ( m_ID != INVALID_ELEMENT_ID )
    {
        CElementIDs::SetElement ( m_ID, NULL );

        // Got a clientside ID? Push it back on our stack so we don't run out of client id's
        if ( IsLocalEntity () )
        {
            CElementIDs::PushClientID ( m_ID );
        }
    }

    // Remove our custom data
    if ( m_pCustomData )
    {
        delete m_pCustomData;
    }

    // Detach from everything
    AttachTo( NULL );
    while( m_AttachedEntities.size() )
    {
        CClientEntity* pAttachedEntity = m_AttachedEntities.back();
        pAttachedEntity->AttachTo( NULL );
    }
    m_bDisallowAttaching = true;
    assert( !m_pAttachedToEntity && m_AttachedEntities.empty() );

    RemoveAllCollisions ();

    if ( m_pEventManager )
    {
        delete m_pEventManager;
        m_pEventManager = NULL;
    }

    if ( m_pElementGroup )
    {
        m_pElementGroup->Remove ( this );
    }

    if ( m_OriginSourceUsers.size () > 0 )
    {
        list < CClientPed* > ::iterator iterUsers = m_OriginSourceUsers.begin ();
        for ( ; iterUsers != m_OriginSourceUsers.end () ; iterUsers++ )
        {
            CClientPed* pModel = *iterUsers;
            if ( pModel->m_interp.pTargetOriginSource == this )
            {
                pModel->m_interp.pTargetOriginSource = NULL;
                pModel->m_interp.bHadOriginSource = true;
            }
        }
        m_OriginSourceUsers.clear ();
    }

    // Unlink our contacts
    list < CClientPed * > ::iterator iterContacts = m_Contacts.begin ();
    for ( ; iterContacts != m_Contacts.end () ; iterContacts++ )
    {
        CClientPed * pModel = *iterContacts;
        if ( pModel->GetCurrentContactEntity () == this )
        {
            pModel->SetCurrentContactEntity ( NULL );
        }
    }
    m_Contacts.clear ();

    // Unlink disabled-collisions
    while ( !m_DisabledCollisions.empty () )
    {
        CClientEntity * pEntity = m_DisabledCollisions.begin ()->first;
        SetCollidableWith ( pEntity, true );
    }

    // Remove from spatial database
    if ( !g_pClientGame->IsBeingDeleted () )
        GetClientSpatialDatabase ()->RemoveEntity ( this );

    // Ensure not referenced in the disabled collisions list
    assert ( !MapContains ( g_pClientGame->m_AllDisabledCollisions, this ) );

    // Ensure nothing has inadvertently set a parent
    assert ( m_pParent == NULL );

    if ( !g_pClientGame->IsBeingDeleted () )
        CClientEntityRefManager::OnEntityDelete ( this );

//.........这里部分代码省略.........
开发者ID:Anubhav652,项目名称:mtasa-blue,代码行数:101,代码来源:CClientEntity.cpp


注:本文中的CClientPed::SetCurrentContactEntity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。