CVehicle::~CVehicle ( void ) { if ( m_pJackingPlayer && m_pJackingPlayer->GetJackingVehicle () == this ) { if ( m_pJackingPlayer->GetVehicleAction () == CPlayer::VEHICLEACTION_JACKING ) { m_pJackingPlayer->SetVehicleAction ( CPlayer::VEHICLEACTION_NONE ); } m_pJackingPlayer->SetJackingVehicle ( NULL ); } // Unset any tow links if ( m_pTowedVehicle ) m_pTowedVehicle->SetTowedByVehicle ( NULL ); if ( m_pTowedByVehicle ) m_pTowedByVehicle->SetTowedVehicle ( NULL ); // Make sure nobody's syncing us SetSyncer ( NULL ); // Unreference from our occupators for ( unsigned int i = 0; i < MAX_VEHICLE_SEATS; i++ ) { if ( m_pOccupants [i] ) { m_pOccupants [i]->SetOccupiedVehicle ( NULL, 0 ); m_pOccupants [i]->SetVehicleAction ( CPed::VEHICLEACTION_NONE ); } } delete m_pUpgrades; // Remove us from the vehicle manager Unlink (); }
CObject::~CObject ( void ) { if ( m_pMoveAnimation != NULL) { delete m_pMoveAnimation; m_pMoveAnimation = NULL; } // Remove syncer SetSyncer ( NULL ); // Unlink us from manager Unlink (); }
CPed::~CPed ( void ) { // Make sure we've no longer occupied any vehicle if ( m_pVehicle ) { m_pVehicle->SetOccupant ( NULL, m_uiVehicleSeat ); } SetSyncer ( NULL ); delete m_pClothes; delete m_pTasks; if ( m_pContactElement ) m_pContactElement->RemoveOriginSourceUser ( this ); // Remove us from the Ped manager Unlink (); }