From fe918d41c249205754a48010a9d69cfd25b406ff Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sun, 6 Dec 2020 19:30:51 +0300 Subject: garages revision + some fixes --- src/vehicles/Automobile.h | 6 ++++++ src/vehicles/Vehicle.h | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src/vehicles') diff --git a/src/vehicles/Automobile.h b/src/vehicles/Automobile.h index b2f0643c..1430e7ba 100644 --- a/src/vehicles/Automobile.h +++ b/src/vehicles/Automobile.h @@ -35,6 +35,9 @@ public: float m_aWheelPosition[4]; float m_aWheelSpeed[4]; uint8 m_auto_unused2; +#if (defined GTA_PS2 && !defined FIX_BUGS) + uint8 m_bombType : 3; +#endif uint8 bTaxiLight : 1; uint8 bFixedColour : 1; uint8 bBigWheels : 1; @@ -44,6 +47,9 @@ public: uint8 bTankDetonateCars : 1; uint8 bStuckInSand : 1; uint8 bHeliDestroyed : 1; +#if (defined GTA_PS2 && !defined FIX_BUGS) + CEntity* m_pBombRigger; +#endif int16 m_doingBurnout; uint16 m_hydraulicState; uint32 m_nBusDoorTimerEnd; diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index 004f1fd9..f37bf6ad 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -248,8 +248,9 @@ public: uint8 bRestingOnPhysical : 1; // Dont go static cause car is sitting on a physical object that might get removed uint8 bParking : 1; uint8 bCanPark : 1; - +#if (!defined GTA_PS2 || defined FIX_BUGS) uint8 m_bombType : 3; +#endif uint8 bDriverLastFrame : 1; int8 m_numPedsUseItAsCover; @@ -259,7 +260,9 @@ public: float m_fHealth; // 1000.0f = full health. 250.0f = fire. 0 -> explode uint8 m_nCurrentGear; float m_fChangeGearTime; +#if (!defined GTA_PS2 || defined FIX_BUGS) CEntity* m_pBombRigger; +#endif uint32 m_nSetPieceExtendedRangeTime; uint32 m_nGunFiringTime; // last time when gun on vehicle was fired (used on boats) uint32 m_nTimeOfDeath; -- cgit v1.2.3 From 406f64694990ca84622205538a72e080499b4464 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sun, 6 Dec 2020 21:28:40 +0300 Subject: pool stuff fix --- src/vehicles/Cranes.cpp | 6 +++--- src/vehicles/Vehicle.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/vehicles') diff --git a/src/vehicles/Cranes.cpp b/src/vehicles/Cranes.cpp index 2a571a67..8433a0ba 100644 --- a/src/vehicles/Cranes.cpp +++ b/src/vehicles/Cranes.cpp @@ -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); diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp index f083e0f6..56de3562 100644 --- a/src/vehicles/Vehicle.cpp +++ b/src/vehicles/Vehicle.cpp @@ -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 -- cgit v1.2.3