diff options
author | erorcun <erorcun35@gmail.com> | 2020-10-18 15:38:36 +0200 |
---|---|---|
committer | erorcun <erorcun35@gmail.com> | 2020-10-18 15:38:36 +0200 |
commit | 1b59b2c9bcabb6048c9bc799542ded5cef065075 (patch) | |
tree | 69f79ed181f836f28ce25048670b0f2a014d8f78 /src | |
parent | Fix ped buoyancy (diff) | |
download | re3-1b59b2c9bcabb6048c9bc799542ded5cef065075.tar re3-1b59b2c9bcabb6048c9bc799542ded5cef065075.tar.gz re3-1b59b2c9bcabb6048c9bc799542ded5cef065075.tar.bz2 re3-1b59b2c9bcabb6048c9bc799542ded5cef065075.tar.lz re3-1b59b2c9bcabb6048c9bc799542ded5cef065075.tar.xz re3-1b59b2c9bcabb6048c9bc799542ded5cef065075.tar.zst re3-1b59b2c9bcabb6048c9bc799542ded5cef065075.zip |
Diffstat (limited to '')
-rw-r--r-- | src/peds/Ped.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp index fb74be2a..469cdf4c 100644 --- a/src/peds/Ped.cpp +++ b/src/peds/Ped.cpp @@ -15403,17 +15403,17 @@ CPed::ProcessObjective(void) CVector distance = m_nextRoutePointPos - GetPosition(); distance.z = 0.0f; if (m_objective == OBJECTIVE_GOTO_SHELTER_ON_FOOT) { - if (m_nMoveState == PEDMOVE_SPRINT && distance.Magnitude() < SQR(2.0f)) { + if (m_nMoveState == PEDMOVE_RUN && distance.Magnitude() < SQR(2.0f)) { SetMoveState(PEDMOVE_WALK); bIsRunning = false; } - else if (CWeather::Rain < 0.2f && m_attractor) { + if (CWeather::Rain < 0.2f && m_attractor) { GetPedAttractorManager()->DeRegisterPed(this, m_attractor); return; } } else if (m_objective == OBJECTIVE_GOTO_ICE_CREAM_VAN_ON_FOOT) { - if (m_nMoveState == PEDMOVE_SPRINT && distance.Magnitude() < SQR(4.0f)) { + if (m_nMoveState == PEDMOVE_RUN && distance.Magnitude() < SQR(4.0f)) { SetMoveState(PEDMOVE_WALK); bIsRunning = false; } @@ -15439,8 +15439,10 @@ CPed::ProcessObjective(void) } } if (sq(m_distanceToCountSeekDone) < distance.MagnitudeSqr()) { - if (CTimer::GetTimeInMilliseconds() > m_nPedStateTimer || GetPedState() != PED_SEEK_POS) + if (CTimer::GetTimeInMilliseconds() > m_nPedStateTimer || GetPedState() != PED_SEEK_POS) { + m_vecSeekPos = m_nextRoutePointPos; SetSeek(m_vecSeekPos, m_distanceToCountSeekDone); + } } else { if (!bReachedAttractorHeadingTarget) { @@ -15510,6 +15512,10 @@ CPed::ProcessObjective(void) SetObjective(OBJECTIVE_WAIT_ON_FOOT_AT_ICE_CREAM_VAN); break; } + } else { + m_prevObjective = OBJECTIVE_NONE; + SetObjective(OBJECTIVE_WAIT_ON_FOOT); + m_objectiveTimer = 0; } } } @@ -15693,11 +15699,11 @@ CPed::ProcessObjective(void) } if (!pVan->m_bSirenOrAlarm) { GetPedAttractorManager()->DeRegisterPed(this, m_attractor); - return; // ??? + return; // Why? } if (pVan->GetStatus() == STATUS_WRECKED) { GetPedAttractorManager()->DeRegisterPed(this, m_attractor); - return; // ??? + return; // Why? } break; } |