From f3a931e1c99372ae4bc224ef482d4052a09580cb Mon Sep 17 00:00:00 2001 From: withmorten Date: Sat, 26 Jun 2021 19:14:46 +0200 Subject: Revert "Revert "Redo ReadSaveBuf + common.h cleanup"" This reverts commit af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f. --- src/core/Pools.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/core/Pools.cpp') diff --git a/src/core/Pools.cpp b/src/core/Pools.cpp index 39cfb1d4..5cffe9e4 100644 --- a/src/core/Pools.cpp +++ b/src/core/Pools.cpp @@ -9,6 +9,7 @@ #endif #include "Population.h" #include "ProjectileInfo.h" +#include "SaveBuf.h" #include "Streaming.h" #include "Wanted.h" #include "World.h" @@ -130,14 +131,19 @@ CPools::MakeSureSlotInObjectPoolIsEmpty(int32 slot) void CPools::LoadVehiclePool(uint8* buf, uint32 size) { INITSAVEBUF - int nNumCars = ReadSaveBuf(buf); - int nNumBoats = ReadSaveBuf(buf); + int nNumCars, nNumBoats; + ReadSaveBuf(&nNumCars, buf); + ReadSaveBuf(&nNumBoats, buf); for (int i = 0; i < nNumCars + nNumBoats; i++) { - uint32 type = ReadSaveBuf(buf); - int16 model = ReadSaveBuf(buf); + uint32 type; + int16 model; + int32 slot; + + ReadSaveBuf(&type, buf); + ReadSaveBuf(&model, buf); CStreaming::RequestModel(model, STREAMFLAGS_DEPENDENCY); CStreaming::LoadAllRequestedModels(false); - int32 slot = ReadSaveBuf(buf); + ReadSaveBuf(&slot, buf); CVehicle* pVehicle; #ifdef COMPATIBLE_SAVES if (type == VEHICLE_TYPE_BOAT) -- cgit v1.2.3