void CObject::Unlink ( void ) { // Remove us from the manager's list m_pObjectManager->RemoveFromList ( this ); // Remove LowLod refs in others SetLowLodObject ( NULL ); while ( !m_HighLodObjectList.empty () ) m_HighLodObjectList[0]->SetLowLodObject ( NULL ); }
void CClientObject::Unlink ( void ) { m_pObjectManager->RemoveFromList ( this ); m_pObjectManager->m_Attached.remove ( this ); ListRemove ( m_pObjectManager->m_StreamedIn, this ); g_pClientGame->GetObjectRespawner ()->Unreference ( this ); // Remove LowLod refs in others SetLowLodObject ( NULL ); while ( !m_HighLodObjectList.empty () ) m_HighLodObjectList[0]->SetLowLodObject ( NULL ); }
bool CObject::SetLowLodObject ( CObject* pNewLowLodObject ) { // This object has to be high lod if ( m_bIsLowLod ) return false; // Set or clear? if ( !pNewLowLodObject ) { // Check if already clear if ( !m_pLowLodObject ) return false; // Verify link assert ( ListContains ( m_pLowLodObject->m_HighLodObjectList, this ) ); // Clear there and here ListRemove ( m_pLowLodObject->m_HighLodObjectList, this ); m_pLowLodObject = NULL; return true; } else { // new object has to be low lod if ( !pNewLowLodObject->m_bIsLowLod ) return false; // Remove any previous link SetLowLodObject ( NULL ); // Make new link m_pLowLodObject = pNewLowLodObject; pNewLowLodObject->m_HighLodObjectList.push_back ( this ); return true; } }