Skip to content

Commit

Permalink
Fix crashes on reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
codenulls committed Dec 14, 2018
1 parent dde556e commit 22b7cf3
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Client/game_sa/CPoolsSA.cpp
Expand Up @@ -195,8 +195,7 @@ SClientEntity<CVehicleSA>* CPoolsSA::GetVehicle(DWORD* pGameInterface)

if (dwElementIndexInPool < MAX_VEHICLES)
{
SClientEntity<CVehicleSA>* pVehicleClientEntity = &m_vehiclePool.arrayOfClientEntities[dwElementIndexInPool];
return pVehicleClientEntity->pClientEntity ? pVehicleClientEntity : nullptr;
return &m_vehiclePool.arrayOfClientEntities[dwElementIndexInPool];
}
}
}
Expand Down Expand Up @@ -396,8 +395,7 @@ SClientEntity<CObjectSA>* CPoolsSA::GetObject(DWORD* pGameInterface)

if (dwElementIndexInPool < MAX_OBJECTS)
{
SClientEntity<CObjectSA>* pObjectClientEntity = &m_objectPool.arrayOfClientEntities[dwElementIndexInPool];
return pObjectClientEntity->pClientEntity ? pObjectClientEntity : nullptr;
return &m_objectPool.arrayOfClientEntities[dwElementIndexInPool];
}
}
return nullptr;
Expand Down Expand Up @@ -679,8 +677,7 @@ SClientEntity<CPedSA>* CPoolsSA::GetPed(DWORD* pGameInterface)

if (dwElementIndexInPool < MAX_PEDS)
{
SClientEntity<CPedSA>* pPedClientEntity = &m_pedPool.arrayOfClientEntities[dwElementIndexInPool];
return pPedClientEntity->pClientEntity ? pPedClientEntity : nullptr;
return &m_pedPool.arrayOfClientEntities[dwElementIndexInPool];
}
}
return nullptr;
Expand Down

0 comments on commit 22b7cf3

Please sign in to comment.