summaryrefslogtreecommitdiffstats
path: root/src/control/Phones.cpp
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2021-06-25 23:25:59 +0200
committererorcun <erorcunerorcun@hotmail.com.tr>2021-06-25 23:25:59 +0200
commitaf7573ddbe38e0aaa485877e7ccb2e704b0f5a7f (patch)
tree75a719bb1ab82b354f464562ecc1fae9c55f64d0 /src/control/Phones.cpp
parentMerge pull request #1147 from withmorten/githash (diff)
downloadre3-af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f.tar
re3-af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f.tar.gz
re3-af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f.tar.bz2
re3-af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f.tar.lz
re3-af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f.tar.xz
re3-af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f.tar.zst
re3-af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f.zip
Diffstat (limited to '')
-rw-r--r--src/control/Phones.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/control/Phones.cpp b/src/control/Phones.cpp
index f9cb1421..ef7ecead 100644
--- a/src/control/Phones.cpp
+++ b/src/control/Phones.cpp
@@ -13,7 +13,6 @@
#include "RpAnimBlend.h"
#include "AnimBlendAssociation.h"
#include "soundlist.h"
-#include "SaveBuf.h"
#ifdef FIX_BUGS
#include "Replay.h"
#endif
@@ -213,9 +212,8 @@ void
CPhoneInfo::Load(uint8 *buf, uint32 size)
{
INITSAVEBUF
- int32 max, scriptPhonesMax;
- ReadSaveBuf(&max, buf);
- ReadSaveBuf(&scriptPhonesMax, buf);
+ int max = ReadSaveBuf<int32>(buf);
+ int scriptPhonesMax = ReadSaveBuf<int32>(buf);
#ifdef PEDS_REPORT_CRIMES_ON_PHONE
m_nMax = Min(NUMPHONES, max);
@@ -225,8 +223,7 @@ 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(&phoneToLoad, buf);
+ CPhone phoneToLoad = ReadSaveBuf<CPhone>(buf);
if (ignoreOtherPhones)
continue;
@@ -252,7 +249,7 @@ INITSAVEBUF
m_nScriptPhonesMax = scriptPhonesMax;
for (int i = 0; i < NUMPHONES; i++) {
- ReadSaveBuf(&m_aPhones[i], buf);
+ m_aPhones[i] = ReadSaveBuf<CPhone>(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);