summaryrefslogtreecommitdiffstats
path: root/src/control/Phones.cpp
diff options
context:
space:
mode:
authorwithmorten <morten.with@gmail.com>2021-06-26 19:14:46 +0200
committerwithmorten <morten.with@gmail.com>2021-06-26 19:14:46 +0200
commitf3a931e1c99372ae4bc224ef482d4052a09580cb (patch)
tree13992380234e68b8f1a32030b4df6aa3d6ebbaca /src/control/Phones.cpp
parentMerge pull request #1155 from leanndroguedes/master (diff)
downloadre3-f3a931e1c99372ae4bc224ef482d4052a09580cb.tar
re3-f3a931e1c99372ae4bc224ef482d4052a09580cb.tar.gz
re3-f3a931e1c99372ae4bc224ef482d4052a09580cb.tar.bz2
re3-f3a931e1c99372ae4bc224ef482d4052a09580cb.tar.lz
re3-f3a931e1c99372ae4bc224ef482d4052a09580cb.tar.xz
re3-f3a931e1c99372ae4bc224ef482d4052a09580cb.tar.zst
re3-f3a931e1c99372ae4bc224ef482d4052a09580cb.zip
Diffstat (limited to 'src/control/Phones.cpp')
-rw-r--r--src/control/Phones.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/control/Phones.cpp b/src/control/Phones.cpp
index ef7ecead..f9cb1421 100644
--- a/src/control/Phones.cpp
+++ b/src/control/Phones.cpp
@@ -13,6 +13,7 @@
#include "RpAnimBlend.h"
#include "AnimBlendAssociation.h"
#include "soundlist.h"
+#include "SaveBuf.h"
#ifdef FIX_BUGS
#include "Replay.h"
#endif
@@ -212,8 +213,9 @@ void
CPhoneInfo::Load(uint8 *buf, uint32 size)
{
INITSAVEBUF
- int max = ReadSaveBuf<int32>(buf);
- int scriptPhonesMax = ReadSaveBuf<int32>(buf);
+ int32 max, scriptPhonesMax;
+ ReadSaveBuf(&max, buf);
+ ReadSaveBuf(&scriptPhonesMax, buf);
#ifdef PEDS_REPORT_CRIMES_ON_PHONE
m_nMax = Min(NUMPHONES, max);
@@ -223,7 +225,8 @@ INITSAVEBUF
// We can do it without touching saves. We'll only load script phones, others are already loaded in Initialise
for (int i = 0; i < 50; i++) {
- CPhone phoneToLoad = ReadSaveBuf<CPhone>(buf);
+ CPhone phoneToLoad;
+ ReadSaveBuf(&phoneToLoad, buf);
if (ignoreOtherPhones)
continue;
@@ -249,7 +252,7 @@ INITSAVEBUF
m_nScriptPhonesMax = scriptPhonesMax;
for (int i = 0; i < NUMPHONES; i++) {
- m_aPhones[i] = ReadSaveBuf<CPhone>(buf);
+ ReadSaveBuf(&m_aPhones[i], buf);
// It's saved as building pool index in save file, convert it to true entity
if (m_aPhones[i].m_pEntity) {
m_aPhones[i].m_pEntity = CPools::GetBuildingPool()->GetSlot((uintptr)m_aPhones[i].m_pEntity - 1);