From c798e1bacdaabaf140ff3904948fd7cec46c09bb Mon Sep 17 00:00:00 2001
From: bigbossbro08 <bigbossbro08@gmail.com>
Date: Sun, 10 May 2020 21:49:33 +0600
Subject: Fixed typos and made all assert functions optional

---
 src/control/Script.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

(limited to 'src/control/Script.cpp')

diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index a274c289..df3a489a 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -11205,7 +11205,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);
@@ -11631,12 +11633,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);
@@ -11662,12 +11668,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);
-- 
cgit v1.2.3-70-g09d2