summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2019-11-25 03:25:10 +0100
committereray orçunus <erayorcunus@gmail.com>2019-11-26 00:35:05 +0100
commit680fe0f7e6d4a94d5ee7f95dd6a5926012196e19 (patch)
treeba9e97db70363916e72b630c6fd5b9c927336476 /src/control
parentMerge pull request #272 from erorcun/erorcun (diff)
downloadre3-680fe0f7e6d4a94d5ee7f95dd6a5926012196e19.tar
re3-680fe0f7e6d4a94d5ee7f95dd6a5926012196e19.tar.gz
re3-680fe0f7e6d4a94d5ee7f95dd6a5926012196e19.tar.bz2
re3-680fe0f7e6d4a94d5ee7f95dd6a5926012196e19.tar.lz
re3-680fe0f7e6d4a94d5ee7f95dd6a5926012196e19.tar.xz
re3-680fe0f7e6d4a94d5ee7f95dd6a5926012196e19.tar.zst
re3-680fe0f7e6d4a94d5ee7f95dd6a5926012196e19.zip
Diffstat (limited to 'src/control')
-rw-r--r--src/control/Phones.cpp4
-rw-r--r--src/control/Phones.h12
2 files changed, 10 insertions, 6 deletions
diff --git a/src/control/Phones.cpp b/src/control/Phones.cpp
index ef978868..a5c4f74d 100644
--- a/src/control/Phones.cpp
+++ b/src/control/Phones.cpp
@@ -72,7 +72,7 @@ CPhoneInfo::Load(uint8 *buf, uint32 size)
INITSAVEBUF
m_nMax = ReadSaveBuf<int32>(buf);
m_nNum = ReadSaveBuf<int32>(buf);
- for (int i = 0; i < 50; i++) {
+ for (int i = 0; i < NUMPHONES; i++) {
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) {
@@ -174,7 +174,7 @@ CPhoneInfo::Save(uint8 *buf, uint32 *size)
INITSAVEBUF
WriteSaveBuf(buf, m_nMax);
WriteSaveBuf(buf, m_nNum);
- for(int phoneId = 0; phoneId < 50; phoneId++) {
+ for(int phoneId = 0; phoneId < NUMPHONES; phoneId++) {
CPhone* phone = WriteSaveBuf(buf, m_aPhones[phoneId]);
// Convert entity pointer to building pool index while saving
diff --git a/src/control/Phones.h b/src/control/Phones.h
index 99ec520c..62ea6f50 100644
--- a/src/control/Phones.h
+++ b/src/control/Phones.h
@@ -7,7 +7,7 @@ class CAnimBlendAssociation;
enum {
PHONE_STATE_FREE,
- PHONE_STATE_1,
+ PHONE_STATE_REPORTING_CRIME, // CCivilianPed::ProcessControl sets it but unused
PHONE_STATE_2,
PHONE_STATE_MESSAGE_REMOVED,
PHONE_STATE_ONETIME_MESSAGE_SET,
@@ -18,14 +18,18 @@ enum {
PHONE_STATE_9
};
-struct CPhone
+class CPhone
{
+public:
CVector m_vecPos;
wchar *m_apMessages[6];
uint32 m_lastTimeRepeatedMsgShown;
- CEntity *m_pEntity; // it's building pool index in save files
+ CEntity *m_pEntity; // stored as building pool index in save files
int32 m_nState;
uint8 field_30;
+
+ CPhone() { }
+ ~CPhone() { }
};
static_assert(sizeof(CPhone) == 0x34, "CPhone: error");
@@ -40,7 +44,7 @@ public:
int32 m_nMax;
int32 m_nNum;
- CPhone m_aPhones[50];
+ CPhone m_aPhones[NUMPHONES];
CPhoneInfo() { }
~CPhoneInfo() { }