summaryrefslogtreecommitdiffstats
path: root/src/vehicles/Automobile.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-02 17:02:17 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-02 17:02:17 +0200
commitf372ce156d76350ef4705ecbf488b43484878ca2 (patch)
treeedf87ceceb886b0f8fa9e57a6b357d0f2d670aed /src/vehicles/Automobile.cpp
parentMerge remote-tracking branch 'upstream/master' (diff)
downloadre3-f372ce156d76350ef4705ecbf488b43484878ca2.tar
re3-f372ce156d76350ef4705ecbf488b43484878ca2.tar.gz
re3-f372ce156d76350ef4705ecbf488b43484878ca2.tar.bz2
re3-f372ce156d76350ef4705ecbf488b43484878ca2.tar.lz
re3-f372ce156d76350ef4705ecbf488b43484878ca2.tar.xz
re3-f372ce156d76350ef4705ecbf488b43484878ca2.tar.zst
re3-f372ce156d76350ef4705ecbf488b43484878ca2.zip
Diffstat (limited to '')
-rw-r--r--src/vehicles/Automobile.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index 4593966f..9d602254 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -51,6 +51,13 @@ RwObject *GetCurrentAtomicObjectCB(RwObject *object, void *data);
bool CAutomobile::m_sAllTaxiLights;
+const uint32 CAutomobile::nSaveStructSize =
+#ifdef COMPATIBLE_SAVES
+ 1448;
+#else
+ sizeof(CAutomobile);
+#endif
+
CAutomobile::CAutomobile(int32 id, uint8 CreatedBy)
: CVehicle(CreatedBy)
{
@@ -4580,3 +4587,22 @@ CAutomobile::SetAllTaxiLights(bool set)
{
m_sAllTaxiLights = set;
}
+
+#ifdef COMPATIBLE_SAVES
+void
+CAutomobile::Save(uint8*& buf)
+{
+ CVehicle::Save(buf);
+ WriteSaveBuf<CDamageManager>(buf, Damage);
+ SkipSaveBuf(buf, 800 - sizeof(CDamageManager));
+}
+
+void
+CAutomobile::Load(uint8*& buf)
+{
+ CVehicle::Load(buf);
+ Damage = ReadSaveBuf<CDamageManager>(buf);
+ SkipSaveBuf(buf, 800 - sizeof(CDamageManager));
+ SetupDamageAfterLoad();
+}
+#endif