diff options
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) } |