mirror of
https://github.com/GTAmodding/re3.git
synced 2025-10-11 05:20:35 +00:00
pool stuff fix
This commit is contained in:
parent
17a939e38d
commit
406f646949
10 changed files with 19 additions and 19 deletions
|
@ -629,11 +629,11 @@ void CCranes::Save(uint8* buf, uint32* size)
|
|||
for (int i = 0; i < NUM_CRANES; i++) {
|
||||
CCrane *pCrane = WriteSaveBuf(buf, aCranes[i]);
|
||||
if (pCrane->m_pCraneEntity != nil)
|
||||
pCrane->m_pCraneEntity = (CBuilding*)(CPools::GetBuildingPool()->GetJustIndex(pCrane->m_pCraneEntity) + 1);
|
||||
pCrane->m_pCraneEntity = (CBuilding*)(CPools::GetBuildingPool()->GetJustIndex_NoFreeAssert(pCrane->m_pCraneEntity) + 1);
|
||||
if (pCrane->m_pHook != nil)
|
||||
pCrane->m_pHook = (CObject*)(CPools::GetObjectPool()->GetJustIndex(pCrane->m_pHook) + 1);
|
||||
pCrane->m_pHook = (CObject*)(CPools::GetObjectPool()->GetJustIndex_NoFreeAssert(pCrane->m_pHook) + 1);
|
||||
if (pCrane->m_pVehiclePickedUp != nil)
|
||||
pCrane->m_pVehiclePickedUp = (CVehicle*)(CPools::GetVehiclePool()->GetJustIndex(pCrane->m_pVehiclePickedUp) + 1);
|
||||
pCrane->m_pVehiclePickedUp = (CVehicle*)(CPools::GetVehiclePool()->GetJustIndex_NoFreeAssert(pCrane->m_pVehiclePickedUp) + 1);
|
||||
}
|
||||
|
||||
VALIDATESAVEBUF(*size);
|
||||
|
|
|
@ -2492,7 +2492,7 @@ IsVehiclePointerValid(CVehicle* pVehicle)
|
|||
{
|
||||
if (!pVehicle)
|
||||
return false;
|
||||
int index = CPools::GetVehiclePool()->GetJustIndex(pVehicle);
|
||||
int index = CPools::GetVehiclePool()->GetJustIndex_NoFreeAssert(pVehicle);
|
||||
#ifdef FIX_BUGS
|
||||
if (index < 0 || index >= NUMVEHICLES)
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue