Skip to content

Commit c0bb578

Browse files
committed
Revert "Add asserts to identify the source of a ped related crash"
This reverts commit c390144.
1 parent c390144 commit c0bb578

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed

Client/mods/deathmatch/logic/CClientGame.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4279,10 +4279,7 @@ bool CClientGame::DamageHandler(CPed* pDamagePed, CEventDamage* pEvent)
42794279
SClientEntity<CPedSA>* pPedClientEntity = pPools->GetPed((DWORD*)pDamagePed->GetInterface());
42804280
if (pPedClientEntity)
42814281
{
4282-
assert(pPedClientEntity->pEntity != nullptr);
4283-
assert(pPedClientEntity->pClientEntity != nullptr);
42844282
pDamagedPed = reinterpret_cast<CClientPed*>(pPedClientEntity->pClientEntity);
4285-
assert(pDamagedPed->GetGamePlayer() != nullptr);
42864283
}
42874284
}
42884285

Client/mods/deathmatch/logic/CClientPed.cpp

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)