void CRagdollProp::UpdateOnRemove( void ) { // Set to null so that the destructor's call to DestroyObject won't destroy // m_pObjects[ 0 ] twice since that's the physics object for the prop VPhysicsSetObject( NULL ); RagdollDestroy( m_ragdoll ); // Chain to base after doing our own cleanup to mimic // destructor unwind order BaseClass::UpdateOnRemove(); }
CRagdoll::~CRagdoll( void ) { for ( int i = 0; i < m_ragdoll.listCount; i++ ) { if ( m_ragdoll.list[i].pObject ) { g_pPhysSaveRestoreManager->ForgetModel( m_ragdoll.list[i].pObject ); } } RagdollDestroy( m_ragdoll ); }
CRagdoll::~CRagdoll( void ) { for ( int i = 0; i < m_ragdoll.listCount; i++ ) { IPhysicsObject *pObject = m_ragdoll.list[i].pObject; if ( pObject ) { g_pPhysSaveRestoreManager->ForgetModel( m_ragdoll.list[i].pObject ); // Disable collision on all ragdoll parts before calling RagdollDestroy // (which might cause touch callbacks on the ragdoll otherwise, which is // very bad for a half deleted ragdoll). pObject->EnableCollisions( false ); } } RagdollDestroy( m_ragdoll ); }
void CRagdollProp::UpdateOnRemove( void ) { for ( int i = 0; i < m_ragdoll.listCount; i++ ) { if ( m_ragdoll.list[i].pObject ) { g_pPhysSaveRestoreManager->ForgetModel( m_ragdoll.list[i].pObject ); } } // Set to null so that the destructor's call to DestroyObject won't destroy // m_pObjects[ 0 ] twice since that's the physics object for the prop VPhysicsSetObject( NULL ); RagdollDestroy( m_ragdoll ); // Chain to base after doing our own cleanup to mimic // destructor unwind order BaseClass::UpdateOnRemove(); }