summaryrefslogtreecommitdiffstats
path: root/src/peds/CivilianPed.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-11-20 00:18:37 +0100
committerSergeanur <s.anureev@yandex.ua>2020-11-20 00:18:37 +0100
commitfe40f65703052e4fb4f54fd8a2eec08b26e4313a (patch)
treee64f666fa49a815012cbb1f9facc465d7131a64e /src/peds/CivilianPed.cpp
parentFix mouse lock/high-dpi (diff)
downloadre3-fe40f65703052e4fb4f54fd8a2eec08b26e4313a.tar
re3-fe40f65703052e4fb4f54fd8a2eec08b26e4313a.tar.gz
re3-fe40f65703052e4fb4f54fd8a2eec08b26e4313a.tar.bz2
re3-fe40f65703052e4fb4f54fd8a2eec08b26e4313a.tar.lz
re3-fe40f65703052e4fb4f54fd8a2eec08b26e4313a.tar.xz
re3-fe40f65703052e4fb4f54fd8a2eec08b26e4313a.tar.zst
re3-fe40f65703052e4fb4f54fd8a2eec08b26e4313a.zip
Diffstat (limited to 'src/peds/CivilianPed.cpp')
-rw-r--r--src/peds/CivilianPed.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/peds/CivilianPed.cpp b/src/peds/CivilianPed.cpp
index 18a0e2a3..bb7cfe76 100644
--- a/src/peds/CivilianPed.cpp
+++ b/src/peds/CivilianPed.cpp
@@ -420,6 +420,32 @@ CCivilianPed::ProcessControl(void)
Avoid();
}
+// --MIAMI: Done
+bool
+CPed::RunToReportCrime(eCrimeType crimeToReport)
+{
+ // They changed true into false to make this function unusable. So running to phone actually starts but first frame after that cancels it.
+ if (m_nPedState == PED_SEEK_POS)
+ return false;
+
+ CVector pos = GetPosition();
+ int phoneId = gPhoneInfo.FindNearestFreePhone(&pos);
+
+ if (phoneId == -1)
+ return false;
+
+ CPhone* phone = &gPhoneInfo.m_aPhones[phoneId];
+ if (phone->m_nState != PHONE_STATE_FREE)
+ return false;
+
+ bRunningToPhone = true;
+ SetSeek(phone->m_vecPos, 0.3f);
+ SetMoveState(PEDMOVE_RUN);
+ m_phoneId = phoneId;
+ m_crimeToReportOnPhone = crimeToReport;
+ return true;
+}
+
const int32 gFrequencyOfAttractorAttempt = 11;
const float gDistanceToSeekAttractors = 50.0f;
const float gMaxDistanceToAttract = 10.0f;