summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-24 14:58:25 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-24 14:58:25 +0200
commit8705562559c37d44f113ad71adf09e4b1ace3523 (patch)
tree282aac7fed540bd2a0b80ebdf79d2cc0a70a99e5 /src
parentscript fix (diff)
downloadre3-8705562559c37d44f113ad71adf09e4b1ace3523.tar
re3-8705562559c37d44f113ad71adf09e4b1ace3523.tar.gz
re3-8705562559c37d44f113ad71adf09e4b1ace3523.tar.bz2
re3-8705562559c37d44f113ad71adf09e4b1ace3523.tar.lz
re3-8705562559c37d44f113ad71adf09e4b1ace3523.tar.xz
re3-8705562559c37d44f113ad71adf09e4b1ace3523.tar.zst
re3-8705562559c37d44f113ad71adf09e4b1ace3523.zip
Diffstat (limited to 'src')
-rw-r--r--src/control/Garages.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp
index a177343b..615ba77f 100644
--- a/src/control/Garages.cpp
+++ b/src/control/Garages.cpp
@@ -2119,12 +2119,8 @@ void CGarages::SetAllDoorsBackToOriginalHeight()
// TODO(MIAMI)
void CGarages::Save(uint8 * buf, uint32 * size)
{
-#ifdef FIX_GARAGE_SIZE
- INITSAVEBUF
- *size = (6 * sizeof(uint32) + TOTAL_COLLECTCARS_GARAGES * sizeof(*CarTypesCollected) + sizeof(uint32) + 3 * NUM_GARAGE_STORED_CARS * sizeof(CStoredCar) + NUM_GARAGES * sizeof(CGarage));
-#else
- * size = 5484;
-#endif
+INITSAVEBUF
+ *size = (6 * sizeof(uint32) + TOTAL_COLLECTCARS_GARAGES * sizeof(*CarTypesCollected) + sizeof(uint32) + TOTAL_HIDEOUT_GARAGES * NUM_GARAGE_STORED_CARS * sizeof(CStoredCar) + NUM_GARAGES * sizeof(CGarage));
CloseHideOutGaragesBeforeSave();
WriteSaveBuf(buf, NumGarages);
WriteSaveBuf(buf, (uint32)BombsAreFree);
@@ -2142,9 +2138,7 @@ void CGarages::Save(uint8 * buf, uint32 * size)
}
for (int i = 0; i < NUM_GARAGES; i++)
WriteSaveBuf(buf, aGarages[i]);
-#ifdef FIX_GARAGE_SIZE
- VALIDATESAVEBUF(*size);
-#endif
+VALIDATESAVEBUF(*size);
}
const CStoredCar &CStoredCar::operator=(const CStoredCar & other)
@@ -2169,12 +2163,8 @@ const CStoredCar &CStoredCar::operator=(const CStoredCar & other)
//TODO(MIAMI)
void CGarages::Load(uint8* buf, uint32 size)
{
-#ifdef FIX_GARAGE_SIZE
- INITSAVEBUF
- assert(size == (6 * sizeof(uint32) + TOTAL_COLLECTCARS_GARAGES * sizeof(*CarTypesCollected) + sizeof(uint32) + 3 * NUM_GARAGE_STORED_CARS * sizeof(CStoredCar) + NUM_GARAGES * sizeof(CGarage));
-#else
- assert(size == 5484);
-#endif
+INITSAVEBUF
+ assert(size == (6 * sizeof(uint32) + TOTAL_COLLECTCARS_GARAGES * sizeof(*CarTypesCollected) + sizeof(uint32) + TOTAL_HIDEOUT_GARAGES * NUM_GARAGE_STORED_CARS * sizeof(CStoredCar) + NUM_GARAGES * sizeof(CGarage)));
CloseHideOutGaragesBeforeSave();
NumGarages = ReadSaveBuf<uint32>(buf);
BombsAreFree = ReadSaveBuf<uint32>(buf);
@@ -2203,9 +2193,7 @@ void CGarages::Load(uint8* buf, uint32 size)
else
aGarages[i].UpdateDoorsHeight();
}
-#ifdef FIX_GARAGE_SIZE
- VALIDATESAVEBUF(size);
-#endif
+VALIDATESAVEBUF(size);
MessageEndTime = 0;
bCamShouldBeOutisde = false;