summaryrefslogtreecommitdiffstats
path: root/src/peds/Ped.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-08-18 19:08:27 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-08-18 19:08:27 +0200
commitc559b71bc96c289cdad8c166ec379ee2df93c995 (patch)
treebbc01e39d0a791398312b45ed0adc72f7d20da39 /src/peds/Ped.cpp
parentMerge pull request #692 from jack9267/master (diff)
downloadre3-c559b71bc96c289cdad8c166ec379ee2df93c995.tar
re3-c559b71bc96c289cdad8c166ec379ee2df93c995.tar.gz
re3-c559b71bc96c289cdad8c166ec379ee2df93c995.tar.bz2
re3-c559b71bc96c289cdad8c166ec379ee2df93c995.tar.lz
re3-c559b71bc96c289cdad8c166ec379ee2df93c995.tar.xz
re3-c559b71bc96c289cdad8c166ec379ee2df93c995.tar.zst
re3-c559b71bc96c289cdad8c166ec379ee2df93c995.zip
Diffstat (limited to 'src/peds/Ped.cpp')
-rw-r--r--src/peds/Ped.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index a15927ff..bfcb52e4 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -13363,7 +13363,7 @@ CPed::ProcessObjective(void)
if (m_pMyVehicle) {
m_pMyVehicle->AutoPilot.m_nCruiseSpeed = 0;
} else {
- float closestVehDist = 3600.0f;
+ float closestVehDist = SQR(60.0f);
int16 lastVehicle;
CEntity* vehicles[8];
CWorld::FindObjectsInRange(GetPosition(), 25.0f, true, &lastVehicle, 6, vehicles, false, true, false, false, false);
@@ -13376,11 +13376,11 @@ CPed::ProcessObjective(void)
CVector ourSpeed = GetSpeed();
*/
CVector vehDistVec = nearVeh->GetPosition() - GetPosition();
- if (vehDistVec.Magnitude() < closestVehDist
+ if (vehDistVec.MagnitudeSqr() < closestVehDist
&& m_pedInObjective->m_pMyVehicle != nearVeh)
{
foundVeh = nearVeh;
- closestVehDist = vehDistVec.Magnitude();
+ closestVehDist = vehDistVec.MagnitudeSqr();
}
}
m_pMyVehicle = foundVeh;