Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
finish COMPATIBLE_SAVES and FIX_SAVES
  • Loading branch information
withmorten committed Jul 5, 2021
1 parent ab7513c commit 8129f27ecf9db1b245facda9851153245ad5184f
@@ -50,41 +50,41 @@ void CAutoPilot::RemoveOnePathNode()
#ifdef COMPATIBLE_SAVES #ifdef COMPATIBLE_SAVES
void CAutoPilot::Save(uint8*& buf) void CAutoPilot::Save(uint8*& buf)
{ {
WriteSaveBuf<int32>(buf, m_nCurrentRouteNode); WriteSaveBuf(buf, m_nCurrentRouteNode);
WriteSaveBuf<int32>(buf, m_nNextRouteNode); WriteSaveBuf(buf, m_nNextRouteNode);
WriteSaveBuf<int32>(buf, m_nPrevRouteNode); WriteSaveBuf(buf, m_nPrevRouteNode);
WriteSaveBuf<int32>(buf, m_nTimeEnteredCurve); WriteSaveBuf(buf, m_nTimeEnteredCurve);
WriteSaveBuf<int32>(buf, m_nTimeToSpendOnCurrentCurve); WriteSaveBuf(buf, m_nTimeToSpendOnCurrentCurve);
WriteSaveBuf<uint32>(buf, m_nCurrentPathNodeInfo); WriteSaveBuf(buf, m_nCurrentPathNodeInfo);
WriteSaveBuf<uint32>(buf, m_nNextPathNodeInfo); WriteSaveBuf(buf, m_nNextPathNodeInfo);
WriteSaveBuf<uint32>(buf, m_nPreviousPathNodeInfo); WriteSaveBuf(buf, m_nPreviousPathNodeInfo);
WriteSaveBuf<uint32>(buf, m_nAntiReverseTimer); WriteSaveBuf(buf, m_nAntiReverseTimer);
WriteSaveBuf<uint32>(buf, m_nTimeToStartMission); WriteSaveBuf(buf, m_nTimeToStartMission);
WriteSaveBuf<int8>(buf, m_nPreviousDirection); WriteSaveBuf(buf, m_nPreviousDirection);
WriteSaveBuf<int8>(buf, m_nCurrentDirection); WriteSaveBuf(buf, m_nCurrentDirection);
WriteSaveBuf<int8>(buf, m_nNextDirection); WriteSaveBuf(buf, m_nNextDirection);
WriteSaveBuf<int8>(buf, m_nCurrentLane); WriteSaveBuf(buf, m_nCurrentLane);
WriteSaveBuf<int8>(buf, m_nNextLane); WriteSaveBuf(buf, m_nNextLane);
WriteSaveBuf<uint8>(buf, m_nDrivingStyle); WriteSaveBuf(buf, m_nDrivingStyle);
WriteSaveBuf<uint8>(buf, m_nCarMission); WriteSaveBuf(buf, m_nCarMission);
WriteSaveBuf<uint8>(buf, m_nTempAction); WriteSaveBuf(buf, m_nTempAction);
WriteSaveBuf<uint32>(buf, m_nTimeTempAction); WriteSaveBuf(buf, m_nTimeTempAction);
WriteSaveBuf<float>(buf, m_fMaxTrafficSpeed); WriteSaveBuf(buf, m_fMaxTrafficSpeed);
WriteSaveBuf<uint8>(buf, m_nCruiseSpeed); WriteSaveBuf(buf, m_nCruiseSpeed);
uint8 flags = 0; uint8 flags = 0;
if (m_bSlowedDownBecauseOfCars) flags |= BIT(0); if (m_bSlowedDownBecauseOfCars) flags |= BIT(0);
if (m_bSlowedDownBecauseOfPeds) flags |= BIT(1); if (m_bSlowedDownBecauseOfPeds) flags |= BIT(1);
if (m_bStayInCurrentLevel) flags |= BIT(2); if (m_bStayInCurrentLevel) flags |= BIT(2);
if (m_bStayInFastLane) flags |= BIT(3); if (m_bStayInFastLane) flags |= BIT(3);
if (m_bIgnorePathfinding) flags |= BIT(4); if (m_bIgnorePathfinding) flags |= BIT(4);
WriteSaveBuf<uint8>(buf, flags); WriteSaveBuf(buf, flags);
SkipSaveBuf(buf, 2); ZeroSaveBuf(buf, 2);
WriteSaveBuf<float>(buf, m_vecDestinationCoors.x); WriteSaveBuf(buf, m_vecDestinationCoors.x);
WriteSaveBuf<float>(buf, m_vecDestinationCoors.y); WriteSaveBuf(buf, m_vecDestinationCoors.y);
WriteSaveBuf<float>(buf, m_vecDestinationCoors.z); WriteSaveBuf(buf, m_vecDestinationCoors.z);
SkipSaveBuf(buf, 32); ZeroSaveBuf(buf, 32);
WriteSaveBuf<int16>(buf, m_nPathFindNodesCount); WriteSaveBuf(buf, m_nPathFindNodesCount);
SkipSaveBuf(buf, 6); ZeroSaveBuf(buf, 6);
} }


void CAutoPilot::Load(uint8*& buf) void CAutoPilot::Load(uint8*& buf)
@@ -26,13 +26,6 @@
#include "World.h" #include "World.h"
#include "SaveBuf.h" #include "SaveBuf.h"


#define CRUSHER_GARAGE_X1 (1135.5f)
#define CRUSHER_GARAGE_Y1 (57.0f)
#define CRUSHER_GARAGE_Z1 (-1.0f)
#define CRUSHER_GARAGE_X2 (1149.5f)
#define CRUSHER_GARAGE_Y2 (63.7f)
#define CRUSHER_GARAGE_Z2 (3.5f)

#define ROTATED_DOOR_OPEN_SPEED (0.015f) #define ROTATED_DOOR_OPEN_SPEED (0.015f)
#define ROTATED_DOOR_CLOSE_SPEED (0.02f) #define ROTATED_DOOR_CLOSE_SPEED (0.02f)
#define DEFAULT_DOOR_OPEN_SPEED (0.035f) #define DEFAULT_DOOR_OPEN_SPEED (0.035f)
@@ -1883,11 +1876,12 @@ void CStoredCar::StoreCar(CVehicle* pVehicle)
m_nRadioStation = pVehicle->m_nRadioStation; m_nRadioStation = pVehicle->m_nRadioStation;
m_nVariationA = pVehicle->m_aExtras[0]; m_nVariationA = pVehicle->m_aExtras[0];
m_nVariationB = pVehicle->m_aExtras[1]; m_nVariationB = pVehicle->m_aExtras[1];
m_bBulletproof = pVehicle->bBulletProof; m_nFlags = 0;
m_bFireproof = pVehicle->bFireProof; if (pVehicle->bBulletProof) m_nFlags |= FLAG_BULLETPROOF;
m_bExplosionproof = pVehicle->bExplosionProof; if (pVehicle->bFireProof) m_nFlags |= FLAG_FIREPROOF;
m_bCollisionproof = pVehicle->bCollisionProof; if (pVehicle->bExplosionProof) m_nFlags |= FLAG_EXPLOSIONPROOF;
m_bMeleeproof = pVehicle->bMeleeProof; if (pVehicle->bCollisionProof) m_nFlags |= FLAG_COLLISIONPROOF;
if (pVehicle->bMeleeProof) m_nFlags |= FLAG_MELEEPROOF;
if (pVehicle->IsCar()) if (pVehicle->IsCar())
m_nCarBombType = ((CAutomobile*)pVehicle)->m_bombType; m_nCarBombType = ((CAutomobile*)pVehicle)->m_bombType;
} }
@@ -1936,11 +1930,11 @@ CVehicle* CStoredCar::RestoreCar()
} }
pVehicle->bHasBeenOwnedByPlayer = true; pVehicle->bHasBeenOwnedByPlayer = true;
pVehicle->m_nDoorLock = CARLOCK_UNLOCKED; pVehicle->m_nDoorLock = CARLOCK_UNLOCKED;
pVehicle->bBulletProof = m_bBulletproof; if (m_nFlags & FLAG_BULLETPROOF) pVehicle->bBulletProof = true;
pVehicle->bFireProof = m_bFireproof; if (m_nFlags & FLAG_FIREPROOF) pVehicle->bFireProof = true;
pVehicle->bExplosionProof = m_bExplosionproof; if (m_nFlags & FLAG_EXPLOSIONPROOF) pVehicle->bExplosionProof = true;
pVehicle->bCollisionProof = m_bCollisionproof; if (m_nFlags & FLAG_COLLISIONPROOF) pVehicle->bCollisionProof = true;
pVehicle->bMeleeProof = m_bMeleeproof; if (m_nFlags & FLAG_MELEEPROOF) pVehicle->bMeleeProof = true;
return pVehicle; return pVehicle;
} }


@@ -2327,8 +2321,47 @@ void CGarages::Save(uint8 * buf, uint32 * size)
WriteSaveBuf(buf, aCarsInSafeHouse2[i]); WriteSaveBuf(buf, aCarsInSafeHouse2[i]);
WriteSaveBuf(buf, aCarsInSafeHouse3[i]); WriteSaveBuf(buf, aCarsInSafeHouse3[i]);
} }
for (int i = 0; i < NUM_GARAGES; i++) for (int i = 0; i < NUM_GARAGES; i++) {
#ifdef COMPATIBLE_SAVES
WriteSaveBuf(buf, aGarages[i].m_eGarageType);
WriteSaveBuf(buf, aGarages[i].m_eGarageState);
WriteSaveBuf(buf, aGarages[i].field_2);
WriteSaveBuf(buf, aGarages[i].m_bClosingWithoutTargetCar);
WriteSaveBuf(buf, aGarages[i].m_bDeactivated);
WriteSaveBuf(buf, aGarages[i].m_bResprayHappened);
ZeroSaveBuf(buf, 2);
WriteSaveBuf(buf, aGarages[i].m_nTargetModelIndex);
ZeroSaveBuf(buf, 4 + 4);
WriteSaveBuf(buf, aGarages[i].m_bDoor1PoolIndex);
WriteSaveBuf(buf, aGarages[i].m_bDoor2PoolIndex);
WriteSaveBuf(buf, aGarages[i].m_bDoor1IsDummy);
WriteSaveBuf(buf, aGarages[i].m_bDoor2IsDummy);
WriteSaveBuf(buf, aGarages[i].m_bRecreateDoorOnNextRefresh);
WriteSaveBuf(buf, aGarages[i].m_bRotatedDoor);
WriteSaveBuf(buf, aGarages[i].m_bCameraFollowsPlayer);
ZeroSaveBuf(buf, 1);
WriteSaveBuf(buf, aGarages[i].m_fX1);
WriteSaveBuf(buf, aGarages[i].m_fX2);
WriteSaveBuf(buf, aGarages[i].m_fY1);
WriteSaveBuf(buf, aGarages[i].m_fY2);
WriteSaveBuf(buf, aGarages[i].m_fZ1);
WriteSaveBuf(buf, aGarages[i].m_fZ2);
WriteSaveBuf(buf, aGarages[i].m_fDoorPos);
WriteSaveBuf(buf, aGarages[i].m_fDoorHeight);
WriteSaveBuf(buf, aGarages[i].m_fDoor1X);
WriteSaveBuf(buf, aGarages[i].m_fDoor1Y);
WriteSaveBuf(buf, aGarages[i].m_fDoor2X);
WriteSaveBuf(buf, aGarages[i].m_fDoor2Y);
WriteSaveBuf(buf, aGarages[i].m_fDoor1Z);
WriteSaveBuf(buf, aGarages[i].m_fDoor2Z);
WriteSaveBuf(buf, aGarages[i].m_nTimeToStartAction);
WriteSaveBuf(buf, aGarages[i].m_bCollectedCarsState);
ZeroSaveBuf(buf, 3 + 4 + 4);
ZeroSaveBuf(buf, sizeof(aGarages[i].m_sStoredCar));
#else
WriteSaveBuf(buf, aGarages[i]); WriteSaveBuf(buf, aGarages[i]);
#endif
}
#ifdef FIX_GARAGE_SIZE #ifdef FIX_GARAGE_SIZE
VALIDATESAVEBUF(*size); VALIDATESAVEBUF(*size);
#endif #endif
@@ -2339,11 +2372,7 @@ const CStoredCar &CStoredCar::operator=(const CStoredCar & other)
m_nModelIndex = other.m_nModelIndex; m_nModelIndex = other.m_nModelIndex;
m_vecPos = other.m_vecPos; m_vecPos = other.m_vecPos;
m_vecAngle = other.m_vecAngle; m_vecAngle = other.m_vecAngle;
m_bBulletproof = other.m_bBulletproof; m_nFlags = other.m_nFlags;
m_bFireproof = other.m_bFireproof;
m_bExplosionproof = other.m_bExplosionproof;
m_bCollisionproof = other.m_bCollisionproof;
m_bMeleeproof = other.m_bMeleeproof;
m_nPrimaryColor = other.m_nPrimaryColor; m_nPrimaryColor = other.m_nPrimaryColor;
m_nSecondaryColor = other.m_nSecondaryColor; m_nSecondaryColor = other.m_nSecondaryColor;
m_nRadioStation = other.m_nRadioStation; m_nRadioStation = other.m_nRadioStation;
@@ -2357,7 +2386,7 @@ void CGarages::Load(uint8* buf, uint32 size)
{ {
#ifdef FIX_GARAGE_SIZE #ifdef FIX_GARAGE_SIZE
INITSAVEBUF INITSAVEBUF
assert(size == (6 * sizeof(uint32) + TOTAL_COLLECTCARS_GARAGES * sizeof(*CarTypesCollected) + sizeof(uint32) + 3 * NUM_GARAGE_STORED_CARS * sizeof(CStoredCar) + NUM_GARAGES * sizeof(CGarage)); assert(size == (6 * sizeof(uint32) + TOTAL_COLLECTCARS_GARAGES * sizeof(*CarTypesCollected) + sizeof(uint32) + 3 * NUM_GARAGE_STORED_CARS * sizeof(CStoredCar) + NUM_GARAGES * sizeof(CGarage)));
#else #else
assert(size == 5484); assert(size == 5484);
#endif #endif
@@ -2380,7 +2409,45 @@ void CGarages::Load(uint8* buf, uint32 size)
ReadSaveBuf(&aCarsInSafeHouse3[i], buf); ReadSaveBuf(&aCarsInSafeHouse3[i], buf);
} }
for (int i = 0; i < NUM_GARAGES; i++) { for (int i = 0; i < NUM_GARAGES; i++) {
#ifdef COMPATIBLE_SAVES
ReadSaveBuf(&aGarages[i].m_eGarageType, buf);
ReadSaveBuf(&aGarages[i].m_eGarageState, buf);
ReadSaveBuf(&aGarages[i].field_2, buf);
ReadSaveBuf(&aGarages[i].m_bClosingWithoutTargetCar, buf);
ReadSaveBuf(&aGarages[i].m_bDeactivated, buf);
ReadSaveBuf(&aGarages[i].m_bResprayHappened, buf);
SkipSaveBuf(buf, 2);
ReadSaveBuf(&aGarages[i].m_nTargetModelIndex, buf);
SkipSaveBuf(buf, 4 + 4);
ReadSaveBuf(&aGarages[i].m_bDoor1PoolIndex, buf);
ReadSaveBuf(&aGarages[i].m_bDoor2PoolIndex, buf);
ReadSaveBuf(&aGarages[i].m_bDoor1IsDummy, buf);
ReadSaveBuf(&aGarages[i].m_bDoor2IsDummy, buf);
ReadSaveBuf(&aGarages[i].m_bRecreateDoorOnNextRefresh, buf);
ReadSaveBuf(&aGarages[i].m_bRotatedDoor, buf);
ReadSaveBuf(&aGarages[i].m_bCameraFollowsPlayer, buf);
SkipSaveBuf(buf, 1);
ReadSaveBuf(&aGarages[i].m_fX1, buf);
ReadSaveBuf(&aGarages[i].m_fX2, buf);
ReadSaveBuf(&aGarages[i].m_fY1, buf);
ReadSaveBuf(&aGarages[i].m_fY2, buf);
ReadSaveBuf(&aGarages[i].m_fZ1, buf);
ReadSaveBuf(&aGarages[i].m_fZ2, buf);
ReadSaveBuf(&aGarages[i].m_fDoorPos, buf);
ReadSaveBuf(&aGarages[i].m_fDoorHeight, buf);
ReadSaveBuf(&aGarages[i].m_fDoor1X, buf);
ReadSaveBuf(&aGarages[i].m_fDoor1Y, buf);
ReadSaveBuf(&aGarages[i].m_fDoor2X, buf);
ReadSaveBuf(&aGarages[i].m_fDoor2Y, buf);
ReadSaveBuf(&aGarages[i].m_fDoor1Z, buf);
ReadSaveBuf(&aGarages[i].m_fDoor2Z, buf);
ReadSaveBuf(&aGarages[i].m_nTimeToStartAction, buf);
ReadSaveBuf(&aGarages[i].m_bCollectedCarsState, buf);
SkipSaveBuf(buf, 3 + 4 + 4);
SkipSaveBuf(buf, sizeof(aGarages[i].m_sStoredCar));
#else
ReadSaveBuf(&aGarages[i], buf); ReadSaveBuf(&aGarages[i], buf);
#endif
aGarages[i].m_pDoor1 = nil; aGarages[i].m_pDoor1 = nil;
aGarages[i].m_pDoor2 = nil; aGarages[i].m_pDoor2 = nil;
aGarages[i].m_pTarget = nil; aGarages[i].m_pTarget = nil;
@@ -51,14 +51,17 @@ enum


class CStoredCar class CStoredCar
{ {
enum {
FLAG_BULLETPROOF = 0x1,
FLAG_FIREPROOF = 0x2,
FLAG_EXPLOSIONPROOF = 0x4,
FLAG_COLLISIONPROOF = 0x8,
FLAG_MELEEPROOF = 0x10,
};
int32 m_nModelIndex; int32 m_nModelIndex;
CVector m_vecPos; CVector m_vecPos;
CVector m_vecAngle; CVector m_vecAngle;
int32 m_bBulletproof : 1; int32 m_nFlags;
int32 m_bFireproof : 1;
int32 m_bExplosionproof : 1;
int32 m_bCollisionproof : 1;
int32 m_bMeleeproof : 1;
int8 m_nPrimaryColor; int8 m_nPrimaryColor;
int8 m_nSecondaryColor; int8 m_nSecondaryColor;
int8 m_nRadioStation; int8 m_nRadioStation;
@@ -78,6 +81,13 @@ VALIDATE_SIZE(CStoredCar, 0x28);


#define SWITCH_GARAGE_DISTANCE_CLOSE 40.0f #define SWITCH_GARAGE_DISTANCE_CLOSE 40.0f


#define CRUSHER_GARAGE_X1 (1135.5f)
#define CRUSHER_GARAGE_Y1 (57.0f)
#define CRUSHER_GARAGE_Z1 (-1.0f)
#define CRUSHER_GARAGE_X2 (1149.5f)
#define CRUSHER_GARAGE_Y2 (63.7f)
#define CRUSHER_GARAGE_Z2 (3.5f)

class CGarage class CGarage
{ {
public: public:
@@ -87,7 +97,7 @@ class CGarage
bool m_bClosingWithoutTargetCar; bool m_bClosingWithoutTargetCar;
bool m_bDeactivated; bool m_bDeactivated;
bool m_bResprayHappened; bool m_bResprayHappened;
int m_nTargetModelIndex; int32 m_nTargetModelIndex;
CEntity *m_pDoor1; CEntity *m_pDoor1;
CEntity *m_pDoor2; CEntity *m_pDoor2;
uint8 m_bDoor1PoolIndex; uint8 m_bDoor1PoolIndex;
@@ -18,6 +18,12 @@
#include "Replay.h" #include "Replay.h"
#endif #endif


#ifdef COMPATIBLE_SAVES
#define PHONEINFO_SAVE_SIZE 0xA30
#else
#define PHONEINFO_SAVE_SIZE sizeof(CPhoneInfo)
#endif

CPhoneInfo gPhoneInfo; CPhoneInfo gPhoneInfo;


bool CPhoneInfo::bDisplayingPhoneMessage; // is phone picked up bool CPhoneInfo::bDisplayingPhoneMessage; // is phone picked up
@@ -209,6 +215,22 @@ CPhoneInfo::IsMessageBeingDisplayed(int phoneId)
return pPhoneDisplayingMessages == &m_aPhones[phoneId]; return pPhoneDisplayingMessages == &m_aPhones[phoneId];
} }


#ifdef COMPATIBLE_SAVES
static inline void
LoadPhone(CPhone &phone, uint8 *&buf)
{
ReadSaveBuf(&phone.m_vecPos, buf);
SkipSaveBuf(buf, 6 * 4);
ReadSaveBuf<uint32>(&phone.m_repeatedMessagePickupStart, buf);
uint32 tmp;
ReadSaveBuf(&tmp, buf);
phone.m_pEntity = (CEntity*)(uintptr)tmp;
ReadSaveBuf<PhoneState>(&phone.m_nState, buf);
ReadSaveBuf<bool>(&phone.m_visibleToCam, buf);
SkipSaveBuf(buf, 3);
}
#endif

void void
CPhoneInfo::Load(uint8 *buf, uint32 size) CPhoneInfo::Load(uint8 *buf, uint32 size)
{ {
@@ -226,7 +248,12 @@ INITSAVEBUF
// We can do it without touching saves. We'll only load script phones, others are already loaded in Initialise // We can do it without touching saves. We'll only load script phones, others are already loaded in Initialise
for (int i = 0; i < 50; i++) { for (int i = 0; i < 50; i++) {
CPhone phoneToLoad; CPhone phoneToLoad;
#ifdef COMPATIBLE_SAVES
phoneToLoad.m_apMessages[0]=phoneToLoad.m_apMessages[1]=phoneToLoad.m_apMessages[2]=phoneToLoad.m_apMessages[3]=phoneToLoad.m_apMessages[4]=phoneToLoad.m_apMessages[5] = nil;
LoadPhone(phoneToLoad, buf);
#else
ReadSaveBuf(&phoneToLoad, buf); ReadSaveBuf(&phoneToLoad, buf);
#endif


if (ignoreOtherPhones) if (ignoreOtherPhones)
continue; continue;
@@ -252,7 +279,11 @@ INITSAVEBUF
m_nScriptPhonesMax = scriptPhonesMax; m_nScriptPhonesMax = scriptPhonesMax;


for (int i = 0; i < NUMPHONES; i++) { for (int i = 0; i < NUMPHONES; i++) {
#ifdef COMPATIBLE_SAVES
LoadPhone(m_aPhones[i], buf);
#else
ReadSaveBuf(&m_aPhones[i], buf); ReadSaveBuf(&m_aPhones[i], buf);
#endif
// It's saved as building pool index in save file, convert it to true entity // It's saved as building pool index in save file, convert it to true entity
if (m_aPhones[i].m_pEntity) { if (m_aPhones[i].m_pEntity) {
m_aPhones[i].m_pEntity = CPools::GetBuildingPool()->GetSlot((uintptr)m_aPhones[i].m_pEntity - 1); m_aPhones[i].m_pEntity = CPools::GetBuildingPool()->GetSlot((uintptr)m_aPhones[i].m_pEntity - 1);
@@ -376,7 +407,7 @@ CPhoneInfo::Initialise(void)
void void
CPhoneInfo::Save(uint8 *buf, uint32 *size) CPhoneInfo::Save(uint8 *buf, uint32 *size)
{ {
*size = sizeof(CPhoneInfo); *size = PHONEINFO_SAVE_SIZE;
INITSAVEBUF INITSAVEBUF
WriteSaveBuf(buf, m_nMax); WriteSaveBuf(buf, m_nMax);
WriteSaveBuf(buf, m_nScriptPhonesMax); WriteSaveBuf(buf, m_nScriptPhonesMax);
@@ -385,12 +416,24 @@ INITSAVEBUF
#else #else
for (int phoneId = 0; phoneId < NUMPHONES; phoneId++) { for (int phoneId = 0; phoneId < NUMPHONES; phoneId++) {
#endif #endif
#ifdef COMPATIBLE_SAVES
WriteSaveBuf(buf, m_aPhones[phoneId].m_vecPos);
ZeroSaveBuf(buf, 6 * 4);
WriteSaveBuf(buf, m_aPhones[phoneId].m_repeatedMessagePickupStart);
// Convert entity pointer to building pool index while saving
int32 tmp = m_aPhones[phoneId].m_pEntity ? CPools::GetBuildingPool()->GetJustIndex_NoFreeAssert((CBuilding*)m_aPhones[phoneId].m_pEntity) + 1 : 0;
WriteSaveBuf(buf, tmp);
WriteSaveBuf(buf, m_aPhones[phoneId].m_nState);
WriteSaveBuf(buf, m_aPhones[phoneId].m_visibleToCam);
ZeroSaveBuf(buf, 3);
#else
CPhone* phone = WriteSaveBuf(buf, m_aPhones[phoneId]); CPhone* phone = WriteSaveBuf(buf, m_aPhones[phoneId]);


// Convert entity pointer to building pool index while saving // Convert entity pointer to building pool index while saving
if (phone->m_pEntity) { if (phone->m_pEntity) {
phone->m_pEntity = (CEntity*) (CPools::GetBuildingPool()->GetJustIndex_NoFreeAssert((CBuilding*)phone->m_pEntity) + 1); phone->m_pEntity = (CEntity*) (CPools::GetBuildingPool()->GetJustIndex_NoFreeAssert((CBuilding*)phone->m_pEntity) + 1);
} }
#endif
} }
VALIDATESAVEBUF(*size) VALIDATESAVEBUF(*size)
} }

0 comments on commit 8129f27

Please sign in to comment.