Redo ReadSaveBuf + common.h cleanup

This commit is contained in:
Sergeanur
2021-06-28 03:59:07 +03:00
parent 3587cb029e
commit f8297df9c5
31 changed files with 507 additions and 421 deletions

View File

@@ -50,6 +50,7 @@
#include "Automobile.h"
#include "Bike.h"
#include "Wanted.h"
#include "SaveBuf.h"
bool bAllCarCheat;
@@ -5869,7 +5870,7 @@ void
CAutomobile::Save(uint8*& buf)
{
CVehicle::Save(buf);
WriteSaveBuf<CDamageManager>(buf, Damage);
WriteSaveBuf(buf, Damage);
SkipSaveBuf(buf, 1500 - 672 - sizeof(CDamageManager));
}
@@ -5877,7 +5878,7 @@ void
CAutomobile::Load(uint8*& buf)
{
CVehicle::Load(buf);
Damage = ReadSaveBuf<CDamageManager>(buf);
ReadSaveBuf(&Damage, buf);
SkipSaveBuf(buf, 1500 - 672 - sizeof(CDamageManager));
SetupDamageAfterLoad();
}