summaryrefslogtreecommitdiffstats
path: root/src/core/Zones.cpp
diff options
context:
space:
mode:
authorRoman Masanin <36927roma@gmail.com>2020-10-24 13:20:08 +0200
committerRoman Masanin <36927roma@gmail.com>2020-10-24 13:20:08 +0200
commit39b7075502b91172e557ec17932dfd68c7da96a1 (patch)
tree681194f8c652968c3e525d7c10c25d35e04d499b /src/core/Zones.cpp
parentpeds (diff)
parentmore ScriptSounds (diff)
downloadre3-39b7075502b91172e557ec17932dfd68c7da96a1.tar
re3-39b7075502b91172e557ec17932dfd68c7da96a1.tar.gz
re3-39b7075502b91172e557ec17932dfd68c7da96a1.tar.bz2
re3-39b7075502b91172e557ec17932dfd68c7da96a1.tar.lz
re3-39b7075502b91172e557ec17932dfd68c7da96a1.tar.xz
re3-39b7075502b91172e557ec17932dfd68c7da96a1.tar.zst
re3-39b7075502b91172e557ec17932dfd68c7da96a1.zip
Diffstat (limited to 'src/core/Zones.cpp')
-rw-r--r--src/core/Zones.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/Zones.cpp b/src/core/Zones.cpp
index 288b975e..45fe6fff 100644
--- a/src/core/Zones.cpp
+++ b/src/core/Zones.cpp
@@ -633,14 +633,17 @@ CTheZones::SaveAllZones(uint8 *buffer, uint32 *size)
INITSAVEBUF
int i;
+#define CZONE_SAVE_SIZE (sizeof(char)*8+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(eZoneType)+sizeof(eLevelName)+sizeof(int16)+sizeof(int16)+sizeof(int32)+sizeof(int32)+sizeof(int32))
+
*size = SAVE_HEADER_SIZE
+ sizeof(m_CurrLevel) + sizeof(FindIndex)
+ sizeof(int16) // padding
- + sizeof(NavigationZoneArray) + sizeof(InfoZoneArray) + sizeof(ZoneInfoArray)
+ + CZONE_SAVE_SIZE * ARRAY_SIZE(NavigationZoneArray) + CZONE_SAVE_SIZE * ARRAY_SIZE(InfoZoneArray) + sizeof(ZoneInfoArray)
+ sizeof(TotalNumberOfNavigationZones) + sizeof(TotalNumberOfInfoZones) + sizeof(TotalNumberOfZoneInfos)
+ sizeof(int16) // padding
- + sizeof(MapZoneArray) + sizeof(AudioZoneArray)
+ + CZONE_SAVE_SIZE * ARRAY_SIZE(MapZoneArray) + sizeof(AudioZoneArray)
+ sizeof(TotalNumberOfMapZones) + sizeof(NumberOfAudioZones);
+#undef CZONE_SAVE_SIZE
uint32 length = 0;
WriteSaveHeaderWithLength(buffer, length, 'Z', 'N', 'S', '\0', *size - SAVE_HEADER_SIZE);