diff options
author | Sergeanur <s.anureev@yandex.ua> | 2021-06-25 18:03:05 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-06-25 18:03:51 +0200 |
commit | 2b67aba94cb6448fb24c869559465eddf2bad069 (patch) | |
tree | 5c68ff4f8ce3153640a7b864495e167bec04cce8 /src/core/Zones.cpp | |
parent | Update invite link (diff) | |
download | re3-2b67aba94cb6448fb24c869559465eddf2bad069.tar re3-2b67aba94cb6448fb24c869559465eddf2bad069.tar.gz re3-2b67aba94cb6448fb24c869559465eddf2bad069.tar.bz2 re3-2b67aba94cb6448fb24c869559465eddf2bad069.tar.lz re3-2b67aba94cb6448fb24c869559465eddf2bad069.tar.xz re3-2b67aba94cb6448fb24c869559465eddf2bad069.tar.zst re3-2b67aba94cb6448fb24c869559465eddf2bad069.zip |
Diffstat (limited to 'src/core/Zones.cpp')
-rw-r--r-- | src/core/Zones.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/core/Zones.cpp b/src/core/Zones.cpp index cdae85e1..107b1db8 100644 --- a/src/core/Zones.cpp +++ b/src/core/Zones.cpp @@ -8,6 +8,7 @@ #include "Text.h" #include "World.h" #include "Timer.h" +#include "SaveBuf.h" eLevelName CTheZones::m_CurrLevel; CZone *CTheZones::m_pPlayersZone; @@ -696,17 +697,18 @@ void CTheZones::LoadAllZones(uint8 *buffer, uint32 size) { INITSAVEBUF - int i; + int32 i; CheckSaveHeader(buffer, 'Z', 'N', 'S', '\0', size - SAVE_HEADER_SIZE); - m_pPlayersZone = GetPointerForZoneIndex(ReadSaveBuf<int32>(buffer)); - m_CurrLevel = ReadSaveBuf<eLevelName>(buffer); - FindIndex = ReadSaveBuf<int16>(buffer); - ReadSaveBuf<int16>(buffer); + ReadSaveBuf(&i, buffer); + m_pPlayersZone = GetPointerForZoneIndex(i); + ReadSaveBuf(&m_CurrLevel, buffer); + ReadSaveBuf(&FindIndex, buffer); + SkipSaveBuf(buffer, 2); for(i = 0; i < ARRAY_SIZE(ZoneArray); i++){ - ZoneArray[i] = ReadSaveBuf<CZone>(buffer); + ReadSaveBuf(&ZoneArray[i], buffer); ZoneArray[i].child = GetPointerForZoneIndex((uintptr)ZoneArray[i].child); ZoneArray[i].parent = GetPointerForZoneIndex((uintptr)ZoneArray[i].parent); @@ -714,13 +716,13 @@ CTheZones::LoadAllZones(uint8 *buffer, uint32 size) } for(i = 0; i < ARRAY_SIZE(ZoneInfoArray); i++) - ZoneInfoArray[i] = ReadSaveBuf<CZoneInfo>(buffer); + ReadSaveBuf(&ZoneInfoArray[i], buffer); - TotalNumberOfZones = ReadSaveBuf<int16>(buffer); - TotalNumberOfZoneInfos = ReadSaveBuf<int16>(buffer); + ReadSaveBuf(&TotalNumberOfZones, buffer); + ReadSaveBuf(&TotalNumberOfZoneInfos, buffer); for(i = 0; i < ARRAY_SIZE(MapZoneArray); i++){ - MapZoneArray[i] = ReadSaveBuf<CZone>(buffer); + ReadSaveBuf(&MapZoneArray[i], buffer); /* The call of GetPointerForZoneIndex is wrong, as it is @@ -736,10 +738,10 @@ CTheZones::LoadAllZones(uint8 *buffer, uint32 size) } for(i = 0; i < ARRAY_SIZE(AudioZoneArray); i++) - AudioZoneArray[i] = ReadSaveBuf<int16>(buffer); + ReadSaveBuf(&AudioZoneArray[i], buffer); - TotalNumberOfMapZones = ReadSaveBuf<uint16>(buffer); - NumberOfAudioZones = ReadSaveBuf<uint16>(buffer); + ReadSaveBuf(&TotalNumberOfMapZones, buffer); + ReadSaveBuf(&NumberOfAudioZones, buffer); VALIDATESAVEBUF(size) } |