summaryrefslogtreecommitdiffstats
path: root/src/vehicles/CarGen.cpp
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2021-06-25 23:25:59 +0200
committererorcun <erorcunerorcun@hotmail.com.tr>2021-06-25 23:25:59 +0200
commitaf7573ddbe38e0aaa485877e7ccb2e704b0f5a7f (patch)
tree75a719bb1ab82b354f464562ecc1fae9c55f64d0 /src/vehicles/CarGen.cpp
parentMerge pull request #1147 from withmorten/githash (diff)
downloadre3-af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f.tar
re3-af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f.tar.gz
re3-af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f.tar.bz2
re3-af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f.tar.lz
re3-af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f.tar.xz
re3-af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f.tar.zst
re3-af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f.zip
Diffstat (limited to 'src/vehicles/CarGen.cpp')
-rw-r--r--src/vehicles/CarGen.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/vehicles/CarGen.cpp b/src/vehicles/CarGen.cpp
index 22b2fc60..7524444b 100644
--- a/src/vehicles/CarGen.cpp
+++ b/src/vehicles/CarGen.cpp
@@ -13,7 +13,6 @@
#include "Timer.h"
#include "Vehicle.h"
#include "World.h"
-#include "SaveBuf.h"
uint8 CTheCarGenerators::ProcessCounter;
uint32 CTheCarGenerators::NumOfCarGenerators;
@@ -255,17 +254,14 @@ void CTheCarGenerators::LoadAllCarGenerators(uint8* buffer, uint32 size)
Init();
INITSAVEBUF
CheckSaveHeader(buffer, 'C','G','N','\0', size - SAVE_HEADER_SIZE);
- 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));
+ 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));
for (int i = 0; i < NUM_CARGENS; i++)
- ReadSaveBuf(&CarGeneratorArray[i], buffer);
+ CarGeneratorArray[i] = ReadSaveBuf<CCarGenerator>(buffer);
VALIDATESAVEBUF(size)
}