From f8297df9c5a7d65d5658d1a8d85d391fbb15b95a Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Mon, 28 Jun 2021 03:59:07 +0300 Subject: Redo ReadSaveBuf + common.h cleanup --- src/core/Pools.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/core/Pools.cpp') diff --git a/src/core/Pools.cpp b/src/core/Pools.cpp index d824d498..d1947813 100644 --- a/src/core/Pools.cpp +++ b/src/core/Pools.cpp @@ -14,6 +14,7 @@ #include "Wanted.h" #include "World.h" #include "MemoryHeap.h" +#include "SaveBuf.h" CCPtrNodePool *CPools::ms_pPtrNodePool; CEntryInfoNodePool *CPools::ms_pEntryInfoNodePool; @@ -137,15 +138,20 @@ CPools::MakeSureSlotInObjectPoolIsEmpty(int32 slot) void CPools::LoadVehiclePool(uint8* buf, uint32 size) { INITSAVEBUF - int nNumCars = ReadSaveBuf(buf); - int nNumBoats = ReadSaveBuf(buf); - int nNumBikes = ReadSaveBuf(buf); + int nNumCars, nNumBoats, nNumBikes; + ReadSaveBuf(&nNumCars, buf); + ReadSaveBuf(&nNumBoats, buf); + ReadSaveBuf(&nNumBikes, buf); for (int i = 0; i < nNumCars + nNumBoats + nNumBikes; 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