1
0
mirror of https://github.com/td512/re3.git synced 2026-03-01 08:03:56 +00:00

Redo ReadSaveBuf + common.h cleanup

This commit is contained in:
Sergeanur
2021-06-25 19:03:05 +03:00
parent 6152f02333
commit 2b67aba94c
26 changed files with 398 additions and 337 deletions

View File

@@ -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<int>(buf);
int nNumBoats = ReadSaveBuf<int>(buf);
int nNumCars, nNumBoats;
ReadSaveBuf(&nNumCars, buf);
ReadSaveBuf(&nNumBoats, buf);
for (int i = 0; i < nNumCars + nNumBoats; i++) {
uint32 type = ReadSaveBuf<uint32>(buf);
int16 model = ReadSaveBuf<int16>(buf);
uint32 type;
int16 model;
int32 slot;
ReadSaveBuf(&type, buf);
ReadSaveBuf(&model, buf);
CStreaming::RequestModel(model, STREAMFLAGS_DEPENDENCY);
CStreaming::LoadAllRequestedModels(false);
int32 slot = ReadSaveBuf<int32>(buf);
ReadSaveBuf(&slot, buf);
CVehicle* pVehicle;
#ifdef COMPATIBLE_SAVES
if (type == VEHICLE_TYPE_BOAT)