Merge pull request #772 from Nick007J/miami

Original save/load support + bugfixes
This commit is contained in:
erorcun 2020-10-18 19:37:49 +03:00 committed by GitHub
commit 497c179245
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 157 additions and 92 deletions

View File

@ -2,6 +2,7 @@
#include "Pools.h" #include "Pools.h"
#include "Bike.h"
#include "Boat.h" #include "Boat.h"
#include "CarCtrl.h" #include "CarCtrl.h"
#ifdef MISSION_REPLAY #ifdef MISSION_REPLAY
@ -13,6 +14,8 @@
#include "Wanted.h" #include "Wanted.h"
#include "World.h" #include "World.h"
//--MIAMI: file done
CCPtrNodePool *CPools::ms_pPtrNodePool; CCPtrNodePool *CPools::ms_pPtrNodePool;
CEntryInfoNodePool *CPools::ms_pEntryInfoNodePool; CEntryInfoNodePool *CPools::ms_pEntryInfoNodePool;
CPedPool *CPools::ms_pPedPool; CPedPool *CPools::ms_pPedPool;
@ -24,7 +27,6 @@ CDummyPool *CPools::ms_pDummyPool;
CAudioScriptObjectPool *CPools::ms_pAudioScriptObjectPool; CAudioScriptObjectPool *CPools::ms_pAudioScriptObjectPool;
CColModelPool *CPools::ms_pColModelPool; CColModelPool *CPools::ms_pColModelPool;
//--MIAMI: done
void void
CPools::Initialise(void) CPools::Initialise(void)
{ {
@ -40,7 +42,6 @@ CPools::Initialise(void)
ms_pColModelPool = new CColModelPool(NUMCOLMODELS, "ColModel"); ms_pColModelPool = new CColModelPool(NUMCOLMODELS, "ColModel");
} }
//--MIAMI: done
void void
CPools::ShutDown(void) CPools::ShutDown(void)
{ {
@ -119,7 +120,8 @@ void CPools::LoadVehiclePool(uint8* buf, uint32 size)
INITSAVEBUF INITSAVEBUF
int nNumCars = ReadSaveBuf<int>(buf); int nNumCars = ReadSaveBuf<int>(buf);
int nNumBoats = ReadSaveBuf<int>(buf); int nNumBoats = ReadSaveBuf<int>(buf);
for (int i = 0; i < nNumCars + nNumBoats; i++) { int nNumBikes = ReadSaveBuf<int>(buf);
for (int i = 0; i < nNumCars + nNumBoats + nNumBikes; i++) {
uint32 type = ReadSaveBuf<uint32>(buf); uint32 type = ReadSaveBuf<uint32>(buf);
int16 model = ReadSaveBuf<int16>(buf); int16 model = ReadSaveBuf<int16>(buf);
CStreaming::RequestModel(model, STREAMFLAGS_DEPENDENCY); CStreaming::RequestModel(model, STREAMFLAGS_DEPENDENCY);
@ -131,13 +133,15 @@ INITSAVEBUF
pVehicle = new(slot) CBoat(model, RANDOM_VEHICLE); pVehicle = new(slot) CBoat(model, RANDOM_VEHICLE);
else if (type == VEHICLE_TYPE_CAR) else if (type == VEHICLE_TYPE_CAR)
pVehicle = new(slot) CAutomobile(model, RANDOM_VEHICLE); pVehicle = new(slot) CAutomobile(model, RANDOM_VEHICLE);
else if (type == VEHICLE_TYPE_BIKE)
pVehicle = new(slot) CBike(model, RANDOM_VEHICLE);
else else
assert(0); assert(0);
--CCarCtrl::NumRandomCars; --CCarCtrl::NumRandomCars;
pVehicle->Load(buf); pVehicle->Load(buf);
CWorld::Add(pVehicle); CWorld::Add(pVehicle);
#else #else
char* vbuf = new char[Max(CAutomobile::nSaveStructSize, CBoat::nSaveStructSize)]; char* vbuf = new char[Max(CBike::nSaveStructSize, Max(CAutomobile::nSaveStructSize, CBoat::nSaveStructSize))];
if (type == VEHICLE_TYPE_BOAT) { if (type == VEHICLE_TYPE_BOAT) {
memcpy(vbuf, buf, sizeof(CBoat)); memcpy(vbuf, buf, sizeof(CBoat));
SkipSaveBuf(buf, sizeof(CBoat)); SkipSaveBuf(buf, sizeof(CBoat));
@ -156,6 +160,17 @@ INITSAVEBUF
pAutomobile->Damage = ((CAutomobile*)vbuf)->Damage; pAutomobile->Damage = ((CAutomobile*)vbuf)->Damage;
pAutomobile->SetupDamageAfterLoad(); pAutomobile->SetupDamageAfterLoad();
} }
else if (type == VEHICLE_TYPE_BIKE) {
#ifdef FIX_BUGS
memcpy(vbuf, buf, sizeof(CBike));
#else
memcpy(vbuf, buf, sizeof(CAutomobile));
#endif
SkipSaveBuf(buf, sizeof(CBike));
CBike* pBike = new(slot) CBike(model, RANDOM_VEHICLE);
pVehicle = pBike;
--CCarCtrl::NumRandomCars;
}
else else
assert(0); assert(0);
CVehicle* pBufferVehicle = (CVehicle*)vbuf; CVehicle* pBufferVehicle = (CVehicle*)vbuf;
@ -193,6 +208,7 @@ INITSAVEBUF
(pVehicle->GetAddressOfEntityProperties())[0] = (pBufferVehicle->GetAddressOfEntityProperties())[0]; (pVehicle->GetAddressOfEntityProperties())[0] = (pBufferVehicle->GetAddressOfEntityProperties())[0];
(pVehicle->GetAddressOfEntityProperties())[1] = (pBufferVehicle->GetAddressOfEntityProperties())[1]; (pVehicle->GetAddressOfEntityProperties())[1] = (pBufferVehicle->GetAddressOfEntityProperties())[1];
pVehicle->AutoPilot = pBufferVehicle->AutoPilot; pVehicle->AutoPilot = pBufferVehicle->AutoPilot;
CCarCtrl::UpdateCarCount(pVehicle, false);
CWorld::Add(pVehicle); CWorld::Add(pVehicle);
delete[] vbuf; delete[] vbuf;
#endif #endif
@ -205,6 +221,7 @@ void CPools::SaveVehiclePool(uint8* buf, uint32* size)
INITSAVEBUF INITSAVEBUF
int nNumCars = 0; int nNumCars = 0;
int nNumBoats = 0; int nNumBoats = 0;
int nNumBikes = 0;
int nPoolSize = GetVehiclePool()->GetSize(); int nPoolSize = GetVehiclePool()->GetSize();
for (int i = 0; i < nPoolSize; i++) { for (int i = 0; i < nPoolSize; i++) {
CVehicle* pVehicle = GetVehiclePool()->GetSlot(i); CVehicle* pVehicle = GetVehiclePool()->GetSlot(i);
@ -226,19 +243,25 @@ INITSAVEBUF
++nNumCars; ++nNumCars;
if (pVehicle->IsBoat() && (pVehicle->VehicleCreatedBy == MISSION_VEHICLE || bForceSaving)) if (pVehicle->IsBoat() && (pVehicle->VehicleCreatedBy == MISSION_VEHICLE || bForceSaving))
++nNumBoats; ++nNumBoats;
if (pVehicle->IsBike() && (pVehicle->VehicleCreatedBy == MISSION_VEHICLE || bForceSaving))
++nNumBoats;
#else #else
if (!pVehicle->pDriver && !bHasPassenger) { if (!pVehicle->pDriver && !bHasPassenger) {
if (pVehicle->IsCar() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE) if (pVehicle->IsCar() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE)
++nNumCars; ++nNumCars;
if (pVehicle->IsBoat() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE) if (pVehicle->IsBoat() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE)
++nNumBoats; ++nNumBoats;
if (pVehicle->IsBike() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE)
++nNumBoats;
#endif #endif
} }
} }
*size = nNumCars * (sizeof(uint32) + sizeof(int16) + sizeof(int32) + CAutomobile::nSaveStructSize) + sizeof(int) + *size = nNumCars * (sizeof(uint32) + sizeof(int16) + sizeof(int32) + CAutomobile::nSaveStructSize) + sizeof(int) +
nNumBoats * (sizeof(uint32) + sizeof(int16) + sizeof(int32) + CBoat::nSaveStructSize) + sizeof(int); nNumBoats * (sizeof(uint32) + sizeof(int16) + sizeof(int32) + CBoat::nSaveStructSize) + sizeof(int) +
nNumBikes * (sizeof(uint32) + sizeof(int16) + sizeof(int32) + CBike::nSaveStructSize) + sizeof(int);
WriteSaveBuf(buf, nNumCars); WriteSaveBuf(buf, nNumCars);
WriteSaveBuf(buf, nNumBoats); WriteSaveBuf(buf, nNumBoats);
WriteSaveBuf(buf, nNumBikes);
for (int i = 0; i < nPoolSize; i++) { for (int i = 0; i < nPoolSize; i++) {
CVehicle* pVehicle = GetVehiclePool()->GetSlot(i); CVehicle* pVehicle = GetVehiclePool()->GetSlot(i);
if (!pVehicle) if (!pVehicle)
@ -258,9 +281,9 @@ INITSAVEBUF
#endif #endif
#ifdef COMPATIBLE_SAVES #ifdef COMPATIBLE_SAVES
#ifdef MISSION_REPLAY #ifdef MISSION_REPLAY
if ((pVehicle->IsCar() || pVehicle->IsBoat()) && (pVehicle->VehicleCreatedBy == MISSION_VEHICLE || bForceSaving)) { if ((pVehicle->IsCar() || pVehicle->IsBoat() || pVehicle->IsBike()) && (pVehicle->VehicleCreatedBy == MISSION_VEHICLE || bForceSaving)) {
#else #else
if ((pVehicle->IsCar() || pVehicle->IsBoat()) && pVehicle->VehicleCreatedBy == MISSION_VEHICLE) { if ((pVehicle->IsCar() || pVehicle->IsBoat() || pVehicle->IsBike()) && pVehicle->VehicleCreatedBy == MISSION_VEHICLE) {
#endif #endif
WriteSaveBuf<uint32>(buf, pVehicle->m_vehType); WriteSaveBuf<uint32>(buf, pVehicle->m_vehType);
WriteSaveBuf<int16>(buf, pVehicle->GetModelIndex()); WriteSaveBuf<int16>(buf, pVehicle->GetModelIndex());
@ -290,6 +313,17 @@ INITSAVEBUF
memcpy(buf, pVehicle, sizeof(CBoat)); memcpy(buf, pVehicle, sizeof(CBoat));
SkipSaveBuf(buf, sizeof(CBoat)); SkipSaveBuf(buf, sizeof(CBoat));
} }
#ifdef MISSION_REPLAY
if (pVehicle->IsBike() && (pVehicle->VehicleCreatedBy == MISSION_VEHICLE || bForceSaving)) {
#else
if (pVehicle->IsBike() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE) {
#endif
WriteSaveBuf(buf, (uint32)pVehicle->m_vehType);
WriteSaveBuf(buf, pVehicle->GetModelIndex());
WriteSaveBuf(buf, GetVehicleRef(pVehicle));
memcpy(buf, pVehicle, sizeof(CBike));
SkipSaveBuf(buf, sizeof(CBike));
}
#endif #endif
} }
} }
@ -311,8 +345,9 @@ INITSAVEBUF
++nObjects; ++nObjects;
} }
*size = nObjects * (sizeof(int16) + sizeof(int) + sizeof(CCompressedMatrix) + *size = nObjects * (sizeof(int16) + sizeof(int) + sizeof(CCompressedMatrix) +
sizeof(float) + sizeof(CCompressedMatrix) + sizeof(int8) + 7 * sizeof(bool) + sizeof(float) + sizeof(float) + sizeof(CCompressedMatrix) + sizeof(int8) + 7 * sizeof(bool) + sizeof(int16) +
sizeof(int8) + sizeof(int8) + sizeof(uint32) + 2 * sizeof(uint32)) + sizeof(int); + sizeof(int8) * 2 + sizeof(float) + sizeof(int8) + sizeof(int8) +
sizeof(uint32) + 2 * sizeof(uint32)) + sizeof(int);
CopyToBuf(buf, nObjects); CopyToBuf(buf, nObjects);
for (int i = 0; i < nPoolSize; i++) { for (int i = 0; i < nPoolSize; i++) {
CObject* pObject = GetObjectPool()->GetSlot(i); CObject* pObject = GetObjectPool()->GetSlot(i);
@ -343,6 +378,9 @@ INITSAVEBUF
CopyToBuf(buf, bGlassBroken); CopyToBuf(buf, bGlassBroken);
CopyToBuf(buf, bHasBeenDamaged); CopyToBuf(buf, bHasBeenDamaged);
CopyToBuf(buf, bUseVehicleColours); CopyToBuf(buf, bUseVehicleColours);
CopyToBuf(buf, pObject->m_nCostValue);
CopyToBuf(buf, pObject->m_nBonusValue);
SkipSaveBuf(buf, 1);
CopyToBuf(buf, pObject->m_fCollisionDamageMultiplier); CopyToBuf(buf, pObject->m_fCollisionDamageMultiplier);
CopyToBuf(buf, pObject->m_nCollisionDamageEffect); CopyToBuf(buf, pObject->m_nCollisionDamageEffect);
CopyToBuf(buf, pObject->m_nSpecialCollisionResponseCases); CopyToBuf(buf, pObject->m_nSpecialCollisionResponseCases);
@ -392,6 +430,9 @@ INITSAVEBUF
pBufferObject->bHasBeenDamaged = bitFlag; pBufferObject->bHasBeenDamaged = bitFlag;
CopyFromBuf(buf, bitFlag); CopyFromBuf(buf, bitFlag);
pBufferObject->bUseVehicleColours = bitFlag; pBufferObject->bUseVehicleColours = bitFlag;
CopyFromBuf(buf, pBufferObject->m_nCostValue);
CopyFromBuf(buf, pBufferObject->m_nBonusValue);
SkipSaveBuf(buf, 1);
CopyFromBuf(buf, pBufferObject->m_fCollisionDamageMultiplier); CopyFromBuf(buf, pBufferObject->m_fCollisionDamageMultiplier);
CopyFromBuf(buf, pBufferObject->m_nCollisionDamageEffect); CopyFromBuf(buf, pBufferObject->m_nCollisionDamageEffect);
CopyFromBuf(buf, pBufferObject->m_nSpecialCollisionResponseCases); CopyFromBuf(buf, pBufferObject->m_nSpecialCollisionResponseCases);
@ -426,6 +467,8 @@ INITSAVEBUF
(pObject->GetAddressOfEntityProperties())[1] = (pBufferObject->GetAddressOfEntityProperties())[1]; (pObject->GetAddressOfEntityProperties())[1] = (pBufferObject->GetAddressOfEntityProperties())[1];
#endif #endif
pObject->bHasCollided = false; pObject->bHasCollided = false;
pObject->m_nCostValue = pBufferObject->m_nCostValue;
pObject->m_nBonusValue = pBufferObject->m_nBonusValue;
CWorld::Add(pObject); CWorld::Add(pObject);
delete[] obuf; delete[] obuf;
} }

View File

@ -924,6 +924,7 @@ INITSAVEBUF
for (int i = 0; i < NUMRADARBLIPS; i++) { for (int i = 0; i < NUMRADARBLIPS; i++) {
ms_RadarTrace[i].m_nColor = ReadSaveBuf<uint32>(buf); ms_RadarTrace[i].m_nColor = ReadSaveBuf<uint32>(buf);
ms_RadarTrace[i].m_Radius = ReadSaveBuf<float>(buf);
ms_RadarTrace[i].m_eBlipType = ReadSaveBuf<uint32>(buf); ms_RadarTrace[i].m_eBlipType = ReadSaveBuf<uint32>(buf);
ms_RadarTrace[i].m_nEntityHandle = ReadSaveBuf<int32>(buf); ms_RadarTrace[i].m_nEntityHandle = ReadSaveBuf<int32>(buf);
ms_RadarTrace[i].m_vec2DPos.x = ReadSaveBuf<float>(buf); // CVector2D ms_RadarTrace[i].m_vec2DPos.x = ReadSaveBuf<float>(buf); // CVector2D
@ -934,7 +935,6 @@ INITSAVEBUF
ms_RadarTrace[i].m_bInUse = ReadSaveBuf<bool>(buf); ms_RadarTrace[i].m_bInUse = ReadSaveBuf<bool>(buf);
ms_RadarTrace[i].m_bShortRange = ReadSaveBuf<bool>(buf); ms_RadarTrace[i].m_bShortRange = ReadSaveBuf<bool>(buf);
ms_RadarTrace[i].m_unused = ReadSaveBuf<bool>(buf); ms_RadarTrace[i].m_unused = ReadSaveBuf<bool>(buf);
ms_RadarTrace[i].m_Radius = ReadSaveBuf<float>(buf);
ms_RadarTrace[i].m_wScale = ReadSaveBuf<int16>(buf); ms_RadarTrace[i].m_wScale = ReadSaveBuf<int16>(buf);
ms_RadarTrace[i].m_eBlipDisplay = ReadSaveBuf<uint16>(buf); ms_RadarTrace[i].m_eBlipDisplay = ReadSaveBuf<uint16>(buf);
ms_RadarTrace[i].m_eRadarSprite = ReadSaveBuf<uint16>(buf); ms_RadarTrace[i].m_eRadarSprite = ReadSaveBuf<uint16>(buf);
@ -961,6 +961,7 @@ INITSAVEBUF
sRadarTraceSave *saveStruct = (sRadarTraceSave*) buf; sRadarTraceSave *saveStruct = (sRadarTraceSave*) buf;
saveStruct->m_nColor = ms_RadarTrace[i].m_nColor; saveStruct->m_nColor = ms_RadarTrace[i].m_nColor;
saveStruct->m_Radius = ms_RadarTrace[i].m_Radius;
saveStruct->m_eBlipType = ms_RadarTrace[i].m_eBlipType; saveStruct->m_eBlipType = ms_RadarTrace[i].m_eBlipType;
saveStruct->m_nEntityHandle = ms_RadarTrace[i].m_nEntityHandle; saveStruct->m_nEntityHandle = ms_RadarTrace[i].m_nEntityHandle;
saveStruct->m_vec2DPos = ms_RadarTrace[i].m_vec2DPos; saveStruct->m_vec2DPos = ms_RadarTrace[i].m_vec2DPos;
@ -970,7 +971,6 @@ INITSAVEBUF
saveStruct->m_bInUse = ms_RadarTrace[i].m_bInUse; saveStruct->m_bInUse = ms_RadarTrace[i].m_bInUse;
saveStruct->m_bShortRange = ms_RadarTrace[i].m_bShortRange; saveStruct->m_bShortRange = ms_RadarTrace[i].m_bShortRange;
saveStruct->m_unused = ms_RadarTrace[i].m_unused; saveStruct->m_unused = ms_RadarTrace[i].m_unused;
saveStruct->m_Radius = ms_RadarTrace[i].m_Radius;
saveStruct->m_wScale = ms_RadarTrace[i].m_wScale; saveStruct->m_wScale = ms_RadarTrace[i].m_wScale;
saveStruct->m_eBlipDisplay = ms_RadarTrace[i].m_eBlipDisplay; saveStruct->m_eBlipDisplay = ms_RadarTrace[i].m_eBlipDisplay;
saveStruct->m_eRadarSprite = ms_RadarTrace[i].m_eRadarSprite; saveStruct->m_eRadarSprite = ms_RadarTrace[i].m_eRadarSprite;

View File

@ -137,6 +137,7 @@ struct sRadarTrace
struct sRadarTraceSave struct sRadarTraceSave
{ {
uint32 m_nColor; uint32 m_nColor;
float m_Radius;
uint32 m_eBlipType; // eBlipType uint32 m_eBlipType; // eBlipType
int32 m_nEntityHandle; int32 m_nEntityHandle;
CVector2D m_vec2DPos; CVector2D m_vec2DPos;
@ -146,7 +147,6 @@ struct sRadarTraceSave
bool m_bInUse; bool m_bInUse;
bool m_bShortRange; bool m_bShortRange;
bool m_unused; bool m_unused;
float m_Radius;
int16 m_wScale; int16 m_wScale;
uint16 m_eBlipDisplay; // eBlipDisplay uint16 m_eBlipDisplay; // eBlipDisplay
uint16 m_eRadarSprite; // eRadarSprite uint16 m_eRadarSprite; // eRadarSprite

View File

@ -70,7 +70,8 @@ public:
uint8 bUseVehicleColours : 1; uint8 bUseVehicleColours : 1;
uint8 bIsWeapon : 1; uint8 bIsWeapon : 1;
uint8 bIsStreetLight : 1; uint8 bIsStreetLight : 1;
int8 m_nBonusValue; int8 m_nBonusValue;
uint16 m_nCostValue;
float m_fCollisionDamageMultiplier; float m_fCollisionDamageMultiplier;
uint8 m_nCollisionDamageEffect; uint8 m_nCollisionDamageEffect;
uint8 m_nSpecialCollisionResponseCases; uint8 m_nSpecialCollisionResponseCases;

View File

@ -20040,15 +20040,13 @@ CPed::Save(uint8*& buf)
CopyToBuf(buf, GetPosition().z); CopyToBuf(buf, GetPosition().z);
SkipSaveBuf(buf, 288); SkipSaveBuf(buf, 288);
CopyToBuf(buf, CharCreatedBy); CopyToBuf(buf, CharCreatedBy);
SkipSaveBuf(buf, 351); SkipSaveBuf(buf, 499);
CopyToBuf(buf, m_fHealth); CopyToBuf(buf, m_fHealth);
CopyToBuf(buf, m_fArmour); CopyToBuf(buf, m_fArmour);
SkipSaveBuf(buf, 148); SkipSaveBuf(buf, 172);
for (int i = 0; i < 13; i++) // has to be hardcoded for (int i = 0; i < 10; i++) // has to be hardcoded
m_weapons[i].Save(buf); m_weapons[i].Save(buf);
SkipSaveBuf(buf, 5); SkipSaveBuf(buf, 252);
CopyToBuf(buf, m_maxWeaponTypeAllowed);
SkipSaveBuf(buf, 162);
} }
void void
@ -20060,16 +20058,15 @@ CPed::Load(uint8*& buf)
CopyFromBuf(buf, GetMatrix().GetPosition().z); CopyFromBuf(buf, GetMatrix().GetPosition().z);
SkipSaveBuf(buf, 288); SkipSaveBuf(buf, 288);
CopyFromBuf(buf, CharCreatedBy); CopyFromBuf(buf, CharCreatedBy);
SkipSaveBuf(buf, 351); SkipSaveBuf(buf, 499);
CopyFromBuf(buf, m_fHealth); CopyFromBuf(buf, m_fHealth);
CopyFromBuf(buf, m_fArmour); CopyFromBuf(buf, m_fArmour);
SkipSaveBuf(buf, 148); SkipSaveBuf(buf, 172);
m_currentWeapon = WEAPONTYPE_UNARMED;
CWeapon bufWeapon; CWeapon bufWeapon;
for (int i = 0; i < 13; i++) { // has to be hardcoded for (int i = 0; i < 10; i++) { // has to be hardcoded
bufWeapon.Load(buf); bufWeapon.Load(buf);
if (i >= 10)
continue; // tmp hack before we fix save/load
if (bufWeapon.m_eWeaponType != WEAPONTYPE_UNARMED) { if (bufWeapon.m_eWeaponType != WEAPONTYPE_UNARMED) {
int modelId = CWeaponInfo::GetWeaponInfo(bufWeapon.m_eWeaponType)->m_nModelId; int modelId = CWeaponInfo::GetWeaponInfo(bufWeapon.m_eWeaponType)->m_nModelId;
@ -20084,9 +20081,7 @@ CPed::Load(uint8*& buf)
GiveWeapon(bufWeapon.m_eWeaponType, bufWeapon.m_nAmmoTotal); GiveWeapon(bufWeapon.m_eWeaponType, bufWeapon.m_nAmmoTotal);
} }
} }
SkipSaveBuf(buf, 5); SkipSaveBuf(buf, 252);
CopyFromBuf(buf, m_maxWeaponTypeAllowed);
SkipSaveBuf(buf, 162);
} }
#undef CopyFromBuf #undef CopyFromBuf
#undef CopyToBuf #undef CopyToBuf

View File

@ -135,8 +135,10 @@ void CPedAttractorManager::RemoveIceCreamVanEffects(C2dEffect* pEffect)
if (vVehicleToEffect.empty()) if (vVehicleToEffect.empty())
return; return;
for (std::vector<CVehicleToEffect>::const_iterator assoc = vVehicleToEffect.cbegin(); assoc != vVehicleToEffect.cend();) { for (std::vector<CVehicleToEffect>::const_iterator assoc = vVehicleToEffect.cbegin(); assoc != vVehicleToEffect.cend();) {
if (assoc->GetVehicle() != pVehicle) if (assoc->GetVehicle() != pVehicle) {
return; assoc++;
continue;
}
uint32 total = 0; uint32 total = 0;
for (uint32 j = 0; j < NUM_ATTRACTORS_FOR_ICECREAM_VAN; j++) { for (uint32 j = 0; j < NUM_ATTRACTORS_FOR_ICECREAM_VAN; j++) {
if (FindAssociatedAttractor(assoc->GetEffect(j), vIceCreamAttractors)) if (FindAssociatedAttractor(assoc->GetEffect(j), vIceCreamAttractors))

View File

@ -23,7 +23,7 @@
const uint32 CPlayerPed::nSaveStructSize = const uint32 CPlayerPed::nSaveStructSize =
#ifdef COMPATIBLE_SAVES #ifdef COMPATIBLE_SAVES
1520; 1752;
#else #else
sizeof(CPlayerPed); sizeof(CPlayerPed);
#endif #endif
@ -1935,7 +1935,7 @@ CPlayerPed::Save(uint8*& buf)
CopyToBuf(buf, m_nTargettableObjects[1]); CopyToBuf(buf, m_nTargettableObjects[1]);
CopyToBuf(buf, m_nTargettableObjects[2]); CopyToBuf(buf, m_nTargettableObjects[2]);
CopyToBuf(buf, m_nTargettableObjects[3]); CopyToBuf(buf, m_nTargettableObjects[3]);
SkipSaveBuf(buf, 116); SkipSaveBuf(buf, 164);
} }
void void
@ -1949,7 +1949,7 @@ CPlayerPed::Load(uint8*& buf)
CopyFromBuf(buf, m_nTargettableObjects[1]); CopyFromBuf(buf, m_nTargettableObjects[1]);
CopyFromBuf(buf, m_nTargettableObjects[2]); CopyFromBuf(buf, m_nTargettableObjects[2]);
CopyFromBuf(buf, m_nTargettableObjects[3]); CopyFromBuf(buf, m_nTargettableObjects[3]);
SkipSaveBuf(buf, 116); SkipSaveBuf(buf, 164);
} }
#undef CopyFromBuf #undef CopyFromBuf
#undef CopyToBuf #undef CopyToBuf

View File

@ -583,7 +583,7 @@ void CHud::Draw()
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(182.0f), SCREEN_SCALE_Y(65.0f), sPrint); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(182.0f), SCREEN_SCALE_Y(65.0f), sPrint);
if (!CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastArmourLoss || CTimer::GetTimeInMilliseconds() > CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastArmourLoss + 2000 || CTimer::GetFrameCounter() & 1) { if (!CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastArmourLoss || CTimer::GetTimeInMilliseconds() > CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastArmourLoss + 2000 || CTimer::GetFrameCounter() & 4) {
// CFont::SetColor(ARMOUR_COLOR); // CFont::SetColor(ARMOUR_COLOR);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(182.0f + 52.0f), SCREEN_SCALE_Y(65.0f), sPrintIcon); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(182.0f + 52.0f), SCREEN_SCALE_Y(65.0f), sPrintIcon);
} }

View File

@ -41,8 +41,10 @@
#include "Timecycle.h" #include "Timecycle.h"
#include "Fluff.h" #include "Fluff.h"
#define BLOCK_COUNT 20 // --MIAMI: file done
#define SIZE_OF_SIMPLEVARS 0xFC
#define BLOCK_COUNT 22
#define SIZE_OF_SIMPLEVARS 0xE4
const uint32 SIZE_OF_ONE_GAME_IN_BYTES = 201729; const uint32 SIZE_OF_ONE_GAME_IN_BYTES = 201729;
@ -60,7 +62,6 @@ int CheckSum;
eLevelName m_LevelToLoad; eLevelName m_LevelToLoad;
char SaveFileNameJustSaved[260]; char SaveFileNameJustSaved[260];
int Slots[SLOT_COUNT]; int Slots[SLOT_COUNT];
CDate CompileDateAndTime;
bool b_FoundRecentSavedGameWantToLoad; bool b_FoundRecentSavedGameWantToLoad;
bool JustLoadedDontFadeInYet; bool JustLoadedDontFadeInYet;
@ -112,13 +113,14 @@ do {\
buf += size;\ buf += size;\
} while (0) } while (0)
#define WriteSaveDataBlock(save_func)\ #define WriteSaveDataBlock(save_func, msg)\
do {\ do {\
size = 0;\ size = 0;\
buf = work_buff;\ buf = work_buff;\
reserved = 0;\ reserved = 0;\
MakeSpaceForSizeInBufferPointer(presize, buf, postsize);\ MakeSpaceForSizeInBufferPointer(presize, buf, postsize);\
save_func(buf, &size);\ save_func(buf, &size);\
debug(msg"== %i \n", size);\
CopySizeAndPreparePointer(presize, buf, postsize, reserved, size);\ CopySizeAndPreparePointer(presize, buf, postsize, reserved, size);\
if (!PcSaveHelper.PcClassSaveRoutine(file, work_buff, buf - work_buff))\ if (!PcSaveHelper.PcClassSaveRoutine(file, work_buff, buf - work_buff))\
return false;\ return false;\
@ -145,9 +147,10 @@ GenericSave(int file)
reserved = 0; reserved = 0;
// Save simple vars // Save simple vars
lastMissionPassed = TheText.Get(CStats::LastMissionPassedName); lastMissionPassed = TheText.Get(CStats::LastMissionPassedName[0] ? CStats::LastMissionPassedName : "ITBEG");
if (lastMissionPassed[0] != '\0') { if (lastMissionPassed[0] != '\0') {
AsciiToUnicode("...'", suffix); AsciiToUnicode("...'", suffix);
suffix[3] = L'\0';
#ifdef FIX_BUGS #ifdef FIX_BUGS
// fix buffer overflow // fix buffer overflow
int len = UnicodeStrlen(lastMissionPassed); int len = UnicodeStrlen(lastMissionPassed);
@ -194,12 +197,6 @@ GenericSave(int file)
WriteDataToBufferPointer(buf, CWeather::NewWeatherType); WriteDataToBufferPointer(buf, CWeather::NewWeatherType);
WriteDataToBufferPointer(buf, CWeather::ForcedWeatherType); WriteDataToBufferPointer(buf, CWeather::ForcedWeatherType);
WriteDataToBufferPointer(buf, CWeather::InterpolationValue); WriteDataToBufferPointer(buf, CWeather::InterpolationValue);
WriteDataToBufferPointer(buf, CompileDateAndTime.m_nSecond);
WriteDataToBufferPointer(buf, CompileDateAndTime.m_nMinute);
WriteDataToBufferPointer(buf, CompileDateAndTime.m_nHour);
WriteDataToBufferPointer(buf, CompileDateAndTime.m_nDay);
WriteDataToBufferPointer(buf, CompileDateAndTime.m_nMonth);
WriteDataToBufferPointer(buf, CompileDateAndTime.m_nYear);
WriteDataToBufferPointer(buf, CWeather::WeatherTypeInList); WriteDataToBufferPointer(buf, CWeather::WeatherTypeInList);
#ifdef COMPATIBLE_SAVES #ifdef COMPATIBLE_SAVES
// converted to float for compatibility with original format // converted to float for compatibility with original format
@ -227,6 +224,7 @@ GenericSave(int file)
buf += 4; buf += 4;
postsize = buf; postsize = buf;
CTheScripts::SaveAllScripts(buf, &size); CTheScripts::SaveAllScripts(buf, &size);
debug("ScriptSize== %i \n", size);
CopySizeAndPreparePointer(presize, buf, postsize, reserved, size); CopySizeAndPreparePointer(presize, buf, postsize, reserved, size);
if (!PcSaveHelper.PcClassSaveRoutine(file, work_buff, buf - work_buff)) if (!PcSaveHelper.PcClassSaveRoutine(file, work_buff, buf - work_buff))
return false; return false;
@ -234,28 +232,28 @@ GenericSave(int file)
totalSize = buf - work_buff; totalSize = buf - work_buff;
// Save the rest // Save the rest
WriteSaveDataBlock(CPools::SavePedPool); WriteSaveDataBlock(CPools::SavePedPool, "PedPoolSize");
WriteSaveDataBlock(CGarages::Save); WriteSaveDataBlock(CGarages::Save, "GaragesSize");
WriteSaveDataBlock(CGameLogic::Save); WriteSaveDataBlock(CGameLogic::Save, "GameLogicSize");
WriteSaveDataBlock(CPools::SaveVehiclePool); WriteSaveDataBlock(CPools::SaveVehiclePool, "VehPoolSize");
WriteSaveDataBlock(CPools::SaveObjectPool); WriteSaveDataBlock(CPools::SaveObjectPool, "ObjectPoolSize");
WriteSaveDataBlock(ThePaths.Save); WriteSaveDataBlock(ThePaths.Save, "ThePathsSize");
WriteSaveDataBlock(CCranes::Save); WriteSaveDataBlock(CCranes::Save, "CranesSize");
WriteSaveDataBlock(CPickups::Save); WriteSaveDataBlock(CPickups::Save, "PickUpsSize");
WriteSaveDataBlock(gPhoneInfo.Save); WriteSaveDataBlock(gPhoneInfo.Save, "PhoneInfoSize");
WriteSaveDataBlock(CRestart::SaveAllRestartPoints); WriteSaveDataBlock(CRestart::SaveAllRestartPoints, "RestartPointsBufferSize");
WriteSaveDataBlock(CRadar::SaveAllRadarBlips); WriteSaveDataBlock(CRadar::SaveAllRadarBlips, "RadarBlipsBufferSize");
WriteSaveDataBlock(CTheZones::SaveAllZones); WriteSaveDataBlock(CTheZones::SaveAllZones, "AllZonesBufferSize");
WriteSaveDataBlock(CGangs::SaveAllGangData); WriteSaveDataBlock(CGangs::SaveAllGangData, "AllGangDataSize");
WriteSaveDataBlock(CTheCarGenerators::SaveAllCarGenerators); WriteSaveDataBlock(CTheCarGenerators::SaveAllCarGenerators, "AllCarGeneratorsSize");
WriteSaveDataBlock(CParticleObject::SaveParticle); WriteSaveDataBlock(CParticleObject::SaveParticle, "ParticlesSize");
WriteSaveDataBlock(cAudioScriptObject::SaveAllAudioScriptObjects); WriteSaveDataBlock(cAudioScriptObject::SaveAllAudioScriptObjects, "AllAudioScriptObjectsSize");
WriteSaveDataBlock(CScriptPaths::Save); WriteSaveDataBlock(CScriptPaths::Save, "ScriptPathsSize");
WriteSaveDataBlock(CWorld::Players[CWorld::PlayerInFocus].SavePlayerInfo); WriteSaveDataBlock(CWorld::Players[CWorld::PlayerInFocus].SavePlayerInfo, "PlayerInfoSize");
WriteSaveDataBlock(CStats::SaveStats); WriteSaveDataBlock(CStats::SaveStats, "StatsSize");
WriteSaveDataBlock(CSetPieces::Save); WriteSaveDataBlock(CSetPieces::Save, "SetPiecesSize");
WriteSaveDataBlock(CStreaming::MemoryCardSave); WriteSaveDataBlock(CStreaming::MemoryCardSave, "StreamingSize");
WriteSaveDataBlock(CPedType::Save); WriteSaveDataBlock(CPedType::Save, "PedTypeSize");
// Write padding // Write padding
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
@ -331,12 +329,6 @@ GenericLoad()
ReadDataFromBufferPointer(buf, CWeather::NewWeatherType); ReadDataFromBufferPointer(buf, CWeather::NewWeatherType);
ReadDataFromBufferPointer(buf, CWeather::ForcedWeatherType); ReadDataFromBufferPointer(buf, CWeather::ForcedWeatherType);
ReadDataFromBufferPointer(buf, CWeather::InterpolationValue); ReadDataFromBufferPointer(buf, CWeather::InterpolationValue);
ReadDataFromBufferPointer(buf, CompileDateAndTime.m_nSecond);
ReadDataFromBufferPointer(buf, CompileDateAndTime.m_nMinute);
ReadDataFromBufferPointer(buf, CompileDateAndTime.m_nHour);
ReadDataFromBufferPointer(buf, CompileDateAndTime.m_nDay);
ReadDataFromBufferPointer(buf, CompileDateAndTime.m_nMonth);
ReadDataFromBufferPointer(buf, CompileDateAndTime.m_nYear);
ReadDataFromBufferPointer(buf, CWeather::WeatherTypeInList); ReadDataFromBufferPointer(buf, CWeather::WeatherTypeInList);
#ifdef COMPATIBLE_SAVES #ifdef COMPATIBLE_SAVES
// converted to float for compatibility with original format // converted to float for compatibility with original format
@ -470,8 +462,13 @@ CloseFile(int32 file)
void void
DoGameSpecificStuffAfterSucessLoad() DoGameSpecificStuffAfterSucessLoad()
{ {
CCollision::SortOutCollisionAfterLoad();
CStreaming::LoadSceneCollision(TheCamera.GetPosition());
CStreaming::LoadScene(TheCamera.GetPosition());
CGame::TidyUpMemory(true, false);
StillToFadeOut = true; StillToFadeOut = true;
JustLoadedDontFadeInYet = true; JustLoadedDontFadeInYet = true;
TheCamera.Fade(0.0f, 0);
CTheScripts::Process(); CTheScripts::Process();
} }

View File

@ -25,8 +25,6 @@ bool CheckDataNotCorrupt(int32 slot, char *name);
bool RestoreForStartLoad(); bool RestoreForStartLoad();
int align4bytes(int32 size); int align4bytes(int32 size);
extern class CDate CompileDateAndTime;
extern char DefaultPCSaveFileName[260]; extern char DefaultPCSaveFileName[260];
extern char ValidSaveName[260]; extern char ValidSaveName[260];
extern char LoadFileName[256]; extern char LoadFileName[256];

View File

@ -59,7 +59,7 @@ bool CAutomobile::m_sAllTaxiLights;
const uint32 CAutomobile::nSaveStructSize = const uint32 CAutomobile::nSaveStructSize =
#ifdef COMPATIBLE_SAVES #ifdef COMPATIBLE_SAVES
1448; 1500;
#else #else
sizeof(CAutomobile); sizeof(CAutomobile);
#endif #endif
@ -5713,7 +5713,7 @@ CAutomobile::Save(uint8*& buf)
{ {
CVehicle::Save(buf); CVehicle::Save(buf);
WriteSaveBuf<CDamageManager>(buf, Damage); WriteSaveBuf<CDamageManager>(buf, Damage);
SkipSaveBuf(buf, 800 - sizeof(CDamageManager)); SkipSaveBuf(buf, 1500 - 672 - sizeof(CDamageManager));
} }
void void
@ -5721,7 +5721,7 @@ CAutomobile::Load(uint8*& buf)
{ {
CVehicle::Load(buf); CVehicle::Load(buf);
Damage = ReadSaveBuf<CDamageManager>(buf); Damage = ReadSaveBuf<CDamageManager>(buf);
SkipSaveBuf(buf, 800 - sizeof(CDamageManager)); SkipSaveBuf(buf, 1500 - 672 - sizeof(CDamageManager));
SetupDamageAfterLoad(); SetupDamageAfterLoad();
} }
#endif #endif

View File

@ -39,6 +39,14 @@
//--MIAMI: file done //--MIAMI: file done
const uint32 CBike::nSaveStructSize =
#ifdef COMPATIBLE_SAVES
1260;
#else
sizeof(CBoat);
#endif
// TODO: maybe put this somewhere else // TODO: maybe put this somewhere else
inline void inline void
GetRelativeMatrix(RwMatrix *mat, RwFrame *frm, RwFrame *end) GetRelativeMatrix(RwMatrix *mat, RwFrame *frm, RwFrame *end)
@ -2922,3 +2930,19 @@ CBike::ReduceHornCounter(void)
if(m_nCarHornTimer != 0) if(m_nCarHornTimer != 0)
m_nCarHornTimer--; m_nCarHornTimer--;
} }
#ifdef COMPATIBLE_SAVES
void
CBike::Save(uint8*& buf)
{
CVehicle::Save(buf);
SkipSaveBuf(buf, 1260 - 672);
}
void
CBike::Load(uint8*& buf)
{
CVehicle::Load(buf);
SkipSaveBuf(buf, 1260 - 672);
}
#endif

View File

@ -132,6 +132,12 @@ public:
void Fix(void); void Fix(void);
void SetupModelNodes(void); void SetupModelNodes(void);
void ReduceHornCounter(void); void ReduceHornCounter(void);
#ifdef COMPATIBLE_SAVES
virtual void Save(uint8*& buf);
virtual void Load(uint8*& buf);
#endif
static const uint32 nSaveStructSize;
}; };
// These functions and function names are made up // These functions and function names are made up

View File

@ -43,7 +43,7 @@ CBoat *CBoat::apFrameWakeGeneratingBoats[4];
const uint32 CBoat::nSaveStructSize = const uint32 CBoat::nSaveStructSize =
#ifdef COMPATIBLE_SAVES #ifdef COMPATIBLE_SAVES
1156; 1216;
#else #else
sizeof(CBoat); sizeof(CBoat);
#endif #endif
@ -1449,13 +1449,13 @@ void
CBoat::Save(uint8*& buf) CBoat::Save(uint8*& buf)
{ {
CVehicle::Save(buf); CVehicle::Save(buf);
SkipSaveBuf(buf, 1156 - 648); SkipSaveBuf(buf, 1216 - 672);
} }
void void
CBoat::Load(uint8*& buf) CBoat::Load(uint8*& buf)
{ {
CVehicle::Load(buf); CVehicle::Load(buf);
SkipSaveBuf(buf, 1156 - 648); SkipSaveBuf(buf, 1216 - 672);
} }
#endif #endif

View File

@ -91,7 +91,7 @@ void CCarGenerator::DoInternalProcessing()
pVehicle = pBoat; pVehicle = pBoat;
if (pos.z <= -100.0f) if (pos.z <= -100.0f)
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y); pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
pBoat->bExtendedRange = false; pBoat->bExtendedRange = true;
}else{ }else{
bool groundFound; bool groundFound;
pos = m_vecPos; pos = m_vecPos;

View File

@ -26,7 +26,6 @@ public:
}; };
CBuilding *m_pCraneEntity; CBuilding *m_pCraneEntity;
CObject *m_pHook; CObject *m_pHook;
int32 m_nAudioEntity;
float m_fPickupX1; float m_fPickupX1;
float m_fPickupX2; float m_fPickupX2;
float m_fPickupY1; float m_fPickupY1;

View File

@ -2367,15 +2367,15 @@ CVehicle::Save(uint8*& buf)
WriteSaveBuf<float>(buf, GetPosition().z); WriteSaveBuf<float>(buf, GetPosition().z);
SkipSaveBuf(buf, 16); SkipSaveBuf(buf, 16);
SaveEntityFlags(buf); SaveEntityFlags(buf);
SkipSaveBuf(buf, 212); SkipSaveBuf(buf, 208);
AutoPilot.Save(buf); AutoPilot.Save(buf);
WriteSaveBuf<int8>(buf, m_currentColour1); WriteSaveBuf<int8>(buf, m_currentColour1);
WriteSaveBuf<int8>(buf, m_currentColour2); WriteSaveBuf<int8>(buf, m_currentColour2);
SkipSaveBuf(buf, 2); SkipSaveBuf(buf, 2);
WriteSaveBuf<int16>(buf, m_nAlarmState); WriteSaveBuf<int16>(buf, m_nAlarmState);
SkipSaveBuf(buf, 43); SkipSaveBuf(buf, 42);
WriteSaveBuf<uint8>(buf, m_nNumMaxPassengers); WriteSaveBuf<uint8>(buf, m_nNumMaxPassengers);
SkipSaveBuf(buf, 2); SkipSaveBuf(buf, 3);
WriteSaveBuf<float>(buf, field_1D0[0]); WriteSaveBuf<float>(buf, field_1D0[0]);
WriteSaveBuf<float>(buf, field_1D0[1]); WriteSaveBuf<float>(buf, field_1D0[1]);
WriteSaveBuf<float>(buf, field_1D0[2]); WriteSaveBuf<float>(buf, field_1D0[2]);
@ -2398,13 +2398,13 @@ CVehicle::Save(uint8*& buf)
WriteSaveBuf<uint8>(buf, m_nCurrentGear); WriteSaveBuf<uint8>(buf, m_nCurrentGear);
SkipSaveBuf(buf, 3); SkipSaveBuf(buf, 3);
WriteSaveBuf<float>(buf, m_fChangeGearTime); WriteSaveBuf<float>(buf, m_fChangeGearTime);
SkipSaveBuf(buf, 4); SkipSaveBuf(buf, 12);
WriteSaveBuf<uint32>(buf, m_nTimeOfDeath); WriteSaveBuf<uint32>(buf, m_nTimeOfDeath);
SkipSaveBuf(buf, 2); SkipSaveBuf(buf, 2);
WriteSaveBuf<int16>(buf, m_nBombTimer); WriteSaveBuf<int16>(buf, m_nBombTimer);
SkipSaveBuf(buf, 12); SkipSaveBuf(buf, 12);
WriteSaveBuf<int8>(buf, m_nDoorLock); WriteSaveBuf<int8>(buf, m_nDoorLock);
SkipSaveBuf(buf, 99); SkipSaveBuf(buf, 111);
} }
void void
@ -2430,15 +2430,15 @@ CVehicle::Load(uint8*& buf)
m_matrix = tmp; m_matrix = tmp;
SkipSaveBuf(buf, 16); SkipSaveBuf(buf, 16);
LoadEntityFlags(buf); LoadEntityFlags(buf);
SkipSaveBuf(buf, 212); SkipSaveBuf(buf, 208);
AutoPilot.Load(buf); AutoPilot.Load(buf);
m_currentColour1 = ReadSaveBuf<int8>(buf); m_currentColour1 = ReadSaveBuf<int8>(buf);
m_currentColour2 = ReadSaveBuf<int8>(buf); m_currentColour2 = ReadSaveBuf<int8>(buf);
SkipSaveBuf(buf, 2); SkipSaveBuf(buf, 2);
m_nAlarmState = ReadSaveBuf<int16>(buf); m_nAlarmState = ReadSaveBuf<int16>(buf);
SkipSaveBuf(buf, 43); SkipSaveBuf(buf, 42);
m_nNumMaxPassengers = ReadSaveBuf<int8>(buf); m_nNumMaxPassengers = ReadSaveBuf<int8>(buf);
SkipSaveBuf(buf, 2); SkipSaveBuf(buf, 3);
field_1D0[0] = ReadSaveBuf<float>(buf); field_1D0[0] = ReadSaveBuf<float>(buf);
field_1D0[1] = ReadSaveBuf<float>(buf); field_1D0[1] = ReadSaveBuf<float>(buf);
field_1D0[2] = ReadSaveBuf<float>(buf); field_1D0[2] = ReadSaveBuf<float>(buf);
@ -2460,13 +2460,13 @@ CVehicle::Load(uint8*& buf)
m_nCurrentGear = ReadSaveBuf<uint8>(buf); m_nCurrentGear = ReadSaveBuf<uint8>(buf);
SkipSaveBuf(buf, 3); SkipSaveBuf(buf, 3);
m_fChangeGearTime = ReadSaveBuf<float>(buf); m_fChangeGearTime = ReadSaveBuf<float>(buf);
SkipSaveBuf(buf, 4); SkipSaveBuf(buf, 12);
m_nTimeOfDeath = ReadSaveBuf<uint32>(buf); m_nTimeOfDeath = ReadSaveBuf<uint32>(buf);
SkipSaveBuf(buf, 2); SkipSaveBuf(buf, 2);
m_nBombTimer = ReadSaveBuf<int16>(buf); m_nBombTimer = ReadSaveBuf<int16>(buf);
SkipSaveBuf(buf, 12); SkipSaveBuf(buf, 12);
m_nDoorLock = (eCarLock)ReadSaveBuf<int8>(buf); m_nDoorLock = (eCarLock)ReadSaveBuf<int8>(buf);
SkipSaveBuf(buf, 99); SkipSaveBuf(buf, 111);
} }
#endif #endif