summaryrefslogtreecommitdiffstats
path: root/src/vehicles/CarGen.cpp
diff options
context:
space:
mode:
authorwithmorten <morten.with@gmail.com>2021-06-26 19:14:46 +0200
committerwithmorten <morten.with@gmail.com>2021-06-26 19:14:46 +0200
commitf3a931e1c99372ae4bc224ef482d4052a09580cb (patch)
tree13992380234e68b8f1a32030b4df6aa3d6ebbaca /src/vehicles/CarGen.cpp
parentMerge pull request #1155 from leanndroguedes/master (diff)
downloadre3-f3a931e1c99372ae4bc224ef482d4052a09580cb.tar
re3-f3a931e1c99372ae4bc224ef482d4052a09580cb.tar.gz
re3-f3a931e1c99372ae4bc224ef482d4052a09580cb.tar.bz2
re3-f3a931e1c99372ae4bc224ef482d4052a09580cb.tar.lz
re3-f3a931e1c99372ae4bc224ef482d4052a09580cb.tar.xz
re3-f3a931e1c99372ae4bc224ef482d4052a09580cb.tar.zst
re3-f3a931e1c99372ae4bc224ef482d4052a09580cb.zip
Diffstat (limited to '')
-rw-r--r--src/vehicles/CarGen.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/vehicles/CarGen.cpp b/src/vehicles/CarGen.cpp
index 7524444b..22b2fc60 100644
--- a/src/vehicles/CarGen.cpp
+++ b/src/vehicles/CarGen.cpp
@@ -13,6 +13,7 @@
#include "Timer.h"
#include "Vehicle.h"
#include "World.h"
+#include "SaveBuf.h"
uint8 CTheCarGenerators::ProcessCounter;
uint32 CTheCarGenerators::NumOfCarGenerators;
@@ -254,14 +255,17 @@ void CTheCarGenerators::LoadAllCarGenerators(uint8* buffer, uint32 size)
Init();
INITSAVEBUF
CheckSaveHeader(buffer, 'C','G','N','\0', size - SAVE_HEADER_SIZE);
- assert(ReadSaveBuf<uint32>(buffer) == nGeneralDataSize);
- NumOfCarGenerators = ReadSaveBuf<uint32>(buffer);
- CurrentActiveCount = ReadSaveBuf<uint32>(buffer);
- ProcessCounter = ReadSaveBuf<uint8>(buffer);
- GenerateEvenIfPlayerIsCloseCounter = ReadSaveBuf<uint8>(buffer);
- ReadSaveBuf<int16>(buffer); // alignment
- assert(ReadSaveBuf<uint32>(buffer) == sizeof(CarGeneratorArray));
+ uint32 tmp;
+ ReadSaveBuf(&tmp, buffer);
+ assert(tmp == nGeneralDataSize);
+ ReadSaveBuf(&NumOfCarGenerators, buffer);
+ ReadSaveBuf(&CurrentActiveCount, buffer);
+ ReadSaveBuf(&ProcessCounter, buffer);
+ ReadSaveBuf(&GenerateEvenIfPlayerIsCloseCounter, buffer);
+ SkipSaveBuf(buffer, 2);
+ ReadSaveBuf(&tmp, buffer);
+ assert(tmp == sizeof(CarGeneratorArray));
for (int i = 0; i < NUM_CARGENS; i++)
- CarGeneratorArray[i] = ReadSaveBuf<CCarGenerator>(buffer);
+ ReadSaveBuf(&CarGeneratorArray[i], buffer);
VALIDATESAVEBUF(size)
}