From 6f103a3b8246ed4a883abaea63c6682cdefc6752 Mon Sep 17 00:00:00 2001 From: withmorten Date: Wed, 7 Jul 2021 17:34:02 +0200 Subject: finish COMPATIBLE_SAVES and FIX_INCOMPATIBLE_SAVES --- src/core/Placeable.h | 2 +- src/core/Pools.cpp | 12 ++++++------ src/core/config.h | 4 +++- 3 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src/core') diff --git a/src/core/Placeable.h b/src/core/Placeable.h index 9c8c292a..94be3211 100644 --- a/src/core/Placeable.h +++ b/src/core/Placeable.h @@ -33,4 +33,4 @@ public: bool IsWithinArea(float x1, float y1, float z1, float x2, float y2, float z2); }; -VALIDATE_SIZE(CPlaceable, 0x4C); +VALIDATE_SIZE(CPlaceable, 0x48); diff --git a/src/core/Pools.cpp b/src/core/Pools.cpp index d1947813..a85d6846 100644 --- a/src/core/Pools.cpp +++ b/src/core/Pools.cpp @@ -310,9 +310,9 @@ INITSAVEBUF #else if ((pVehicle->IsCar() || pVehicle->IsBoat() || pVehicle->IsBike()) && pVehicle->VehicleCreatedBy == MISSION_VEHICLE) { #endif - WriteSaveBuf(buf, pVehicle->m_vehType); - WriteSaveBuf(buf, pVehicle->GetModelIndex()); - WriteSaveBuf(buf, GetVehicleRef(pVehicle)); + WriteSaveBuf(buf, pVehicle->m_vehType); + WriteSaveBuf(buf, pVehicle->GetModelIndex()); + WriteSaveBuf(buf, GetVehicleRef(pVehicle)); pVehicle->Save(buf); } #else @@ -321,7 +321,7 @@ INITSAVEBUF #else if (pVehicle->IsCar() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE) { #endif - WriteSaveBuf(buf, (uint32)pVehicle->m_vehType); + WriteSaveBuf(buf, pVehicle->m_vehType); WriteSaveBuf(buf, pVehicle->GetModelIndex()); WriteSaveBuf(buf, GetVehicleRef(pVehicle)); memcpy(buf, pVehicle, sizeof(CAutomobile)); @@ -332,7 +332,7 @@ INITSAVEBUF #else if (pVehicle->IsBoat() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE) { #endif - WriteSaveBuf(buf, (uint32)pVehicle->m_vehType); + WriteSaveBuf(buf, pVehicle->m_vehType); WriteSaveBuf(buf, pVehicle->GetModelIndex()); WriteSaveBuf(buf, GetVehicleRef(pVehicle)); memcpy(buf, pVehicle, sizeof(CBoat)); @@ -343,7 +343,7 @@ INITSAVEBUF #else if (pVehicle->IsBike() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE) { #endif - WriteSaveBuf(buf, (uint32)pVehicle->m_vehType); + WriteSaveBuf(buf, pVehicle->m_vehType); WriteSaveBuf(buf, pVehicle->GetModelIndex()); WriteSaveBuf(buf, GetVehicleRef(pVehicle)); memcpy(buf, pVehicle, sizeof(CBike)); diff --git a/src/core/config.h b/src/core/config.h index ff44eef1..617a1302 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -246,7 +246,8 @@ enum Config { #define FIX_BUGS // fixes bugs that we've came across during reversing. You can undefine this only on release builds. #define MORE_LANGUAGES // Add more translations to the game -#define COMPATIBLE_SAVES // this allows changing structs while keeping saves compatible +#define COMPATIBLE_SAVES // this allows changing structs while keeping saves compatible, and keeps saves compatible between platforms +#define FIX_INCOMPATIBLE_SAVES // try to fix incompatible saves, requires COMPATIBLE_SAVES #define LOAD_INI_SETTINGS // as the name suggests. fundamental for CUSTOM_FRONTEND_OPTIONS #define NO_MOVIES // add option to disable intro videos @@ -454,6 +455,7 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually #define THIS_IS_STUPID #undef MORE_LANGUAGES #undef COMPATIBLE_SAVES +#undef FIX_INCOMPATIBLE_SAVES #undef LOAD_INI_SETTINGS #undef ASPECT_RATIO_SCALE -- cgit v1.2.3