summaryrefslogtreecommitdiff
path: root/src/control/Script.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-05-11 21:07:12 +0300
committerSergeanur <s.anureev@yandex.ua>2020-05-11 21:07:12 +0300
commit0aa7f13c32ea1991f4663f5eff1c37478fdf736f (patch)
treea994ac3a72f9b65dfe6648d3086d4415fe2b1234 /src/control/Script.cpp
parentad90a06a395d6c93d4565705ee70c64a6cc820b8 (diff)
parent85c44715ea4bce92546aefba48dc50f18e64c105 (diff)
Merge branch 'master' into miami
# Conflicts: # src/animation/AnimBlendAssociation.h # src/animation/AnimBlendClumpData.h # src/animation/AnimManager.h # src/animation/FrameUpdate.cpp # src/control/AutoPilot.h # src/control/PathFind.h # src/core/PlayerInfo.h # src/entities/Building.h # src/entities/Dummy.h # src/entities/Entity.h # src/entities/Physical.h # src/entities/Treadable.h # src/modelinfo/BaseModelInfo.h # src/modelinfo/ClumpModelInfo.cpp # src/modelinfo/ClumpModelInfo.h # src/modelinfo/PedModelInfo.h # src/modelinfo/SimpleModelInfo.h # src/modelinfo/TimeModelInfo.h # src/modelinfo/VehicleModelInfo.h # src/objects/CutsceneHead.h # src/objects/CutsceneObject.h # src/objects/DummyObject.h # src/objects/Object.h # src/peds/DummyPed.h # src/peds/PedIK.cpp # src/rw/VisibilityPlugins.cpp # src/vehicles/Automobile.h # src/vehicles/Boat.h # src/vehicles/Heli.h # src/vehicles/Plane.h # src/vehicles/Train.h # src/vehicles/Vehicle.h
Diffstat (limited to 'src/control/Script.cpp')
-rw-r--r--src/control/Script.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 10dcda90..dbe2b090 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -11611,7 +11611,9 @@ INITSAVEBUF
WriteSaveBuf(buf, varSpace);
for (uint32 i = 0; i < varSpace; i++)
WriteSaveBuf(buf, ScriptSpace[i]);
+#ifdef CHECK_STRUCT_SIZES
static_assert(SCRIPT_DATA_SIZE == 968, "CTheScripts::SaveAllScripts");
+#endif
uint32 script_data_size = SCRIPT_DATA_SIZE;
WriteSaveBuf(buf, script_data_size);
WriteSaveBuf(buf, OnAMissionFlag);
@@ -12037,12 +12039,16 @@ void CRunningScript::Save(uint8*& buf)
for (int i = 0; i < 8; i++)
WriteSaveBuf<char>(buf, m_abScriptName[i]);
WriteSaveBuf<uint32>(buf, m_nIp);
+#ifdef CHECK_STRUCT_SIZES
static_assert(MAX_STACK_DEPTH == 6, "Compatibility loss: MAX_STACK_DEPTH != 6");
+#endif
for (int i = 0; i < MAX_STACK_DEPTH; i++)
WriteSaveBuf<uint32>(buf, m_anStack[i]);
WriteSaveBuf<uint16>(buf, m_nStackPointer);
SkipSaveBuf(buf, 2);
+#ifdef CHECK_STRUCT_SIZES
static_assert(NUM_LOCAL_VARS + NUM_TIMERS == 18, "Compatibility loss: NUM_LOCAL_VARS + NUM_TIMERS != 18");
+#endif
for (int i = 0; i < NUM_LOCAL_VARS + NUM_TIMERS; i++)
WriteSaveBuf<int32>(buf, m_anLocalVariables[i]);
WriteSaveBuf<bool>(buf, m_bCondResult);
@@ -12068,12 +12074,16 @@ void CRunningScript::Load(uint8*& buf)
for (int i = 0; i < 8; i++)
m_abScriptName[i] = ReadSaveBuf<char>(buf);
m_nIp = ReadSaveBuf<uint32>(buf);
+#ifdef CHECK_STRUCT_SIZES
static_assert(MAX_STACK_DEPTH == 6, "Compatibility loss: MAX_STACK_DEPTH != 6");
+#endif
for (int i = 0; i < MAX_STACK_DEPTH; i++)
m_anStack[i] = ReadSaveBuf<uint32>(buf);
m_nStackPointer = ReadSaveBuf<uint16>(buf);
SkipSaveBuf(buf, 2);
+#ifdef CHECK_STRUCT_SIZES
static_assert(NUM_LOCAL_VARS + NUM_TIMERS == 18, "Compatibility loss: NUM_LOCAL_VARS + NUM_TIMERS != 18");
+#endif
for (int i = 0; i < NUM_LOCAL_VARS + NUM_TIMERS; i++)
m_anLocalVariables[i] = ReadSaveBuf<int32>(buf);
m_bCondResult = ReadSaveBuf<bool>(buf);