本文整理汇总了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 );
}
示例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 );
//.........这里部分代码省略.........
示例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 );
//.........这里部分代码省略.........