@@ -3584,10 +3584,7 @@ void CClientPed::_CreateModel()
35843584 m_pLoadedModelInfo->ModelAddRef (BLOCKING, " CClientPed::_CreateModel" );
35853585
35863586 // Create the new ped
3587- CPed* gamePed = g_pGame->GetPools ()->AddPed (this , static_cast <ePedModel>(m_ulModel));
3588- m_pPlayerPed = dynamic_cast <CPlayerPed*>(gamePed);
3589- assert (gamePed == nullptr && m_pPlayerPed == nullptr || gamePed != nullptr && m_pPlayerPed != nullptr );
3590-
3587+ m_pPlayerPed = dynamic_cast <CPlayerPed*>(g_pGame->GetPools ()->AddPed (this , static_cast <ePedModel>(m_ulModel)));
35913588 if (m_pPlayerPed)
35923589 {
35933590 // Put our pointer in the stored data and update the remote data with the new model pointer
@@ -3711,10 +3708,7 @@ void CClientPed::_CreateLocalModel()
37113708{
37123709 // Init the local player and grab the pointers
37133710 g_pGame->InitLocalPlayer (this );
3714-
3715- CPed* gamePed = g_pGame->GetPools ()->GetPedFromRef ((DWORD)1 );
3716- m_pPlayerPed = dynamic_cast <CPlayerPed*>(gamePed);
3717- assert (gamePed == nullptr && m_pPlayerPed == nullptr || gamePed != nullptr && m_pPlayerPed != nullptr );
3711+ m_pPlayerPed = dynamic_cast <CPlayerPed*>(g_pGame->GetPools ()->GetPedFromRef ((DWORD)1 ));
37183712
37193713 if (m_pPlayerPed)
37203714 {
@@ -3812,17 +3806,10 @@ void CClientPed::_DestroyModel()
38123806 // Invalidate
38133807 m_pManager->InvalidateEntity (this );
38143808
3815- // Store the amount of peds in the ped pool before removal
3816- unsigned long const previousPedCount = g_pGame->GetPools ()->GetPedCount ();
3817-
38183809 // Remove the ped from the world
38193810 g_pGame->GetPools ()->RemovePed (m_pPlayerPed);
3820- m_pPlayerPed = nullptr ;
3821- m_pTaskManager = nullptr ;
3822-
3823- // Verify that our ped got actually removed from the ped pool
3824- unsigned long const currentPedCount = g_pGame->GetPools ()->GetPedCount ();
3825- assert (currentPedCount < previousPedCount);
3811+ m_pPlayerPed = NULL ;
3812+ m_pTaskManager = NULL ;
38263813
38273814 // Remove the reference to its model
38283815 m_pLoadedModelInfo->RemoveRef ();
0 commit comments