diff options
author | Sergeanur <s.anureev@yandex.ua> | 2021-06-25 18:03:05 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-06-25 18:03:51 +0200 |
commit | 2b67aba94cb6448fb24c869559465eddf2bad069 (patch) | |
tree | 5c68ff4f8ce3153640a7b864495e167bec04cce8 /src/vehicles/CarGen.cpp | |
parent | Update invite link (diff) | |
download | re3-2b67aba94cb6448fb24c869559465eddf2bad069.tar re3-2b67aba94cb6448fb24c869559465eddf2bad069.tar.gz re3-2b67aba94cb6448fb24c869559465eddf2bad069.tar.bz2 re3-2b67aba94cb6448fb24c869559465eddf2bad069.tar.lz re3-2b67aba94cb6448fb24c869559465eddf2bad069.tar.xz re3-2b67aba94cb6448fb24c869559465eddf2bad069.tar.zst re3-2b67aba94cb6448fb24c869559465eddf2bad069.zip |
Diffstat (limited to 'src/vehicles/CarGen.cpp')
-rw-r--r-- | src/vehicles/CarGen.cpp | 20 |
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) } |