diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-08-19 22:34:33 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-08-19 22:34:33 +0200 |
commit | 827b240078132bc893963212871e2d7b6294c6a3 (patch) | |
tree | 4e2c129c0a61c3086cb911576030e43fa317332e /src/peds/Ped.cpp | |
parent | 2 new opcodes (diff) | |
parent | little fix (diff) | |
download | re3-827b240078132bc893963212871e2d7b6294c6a3.tar re3-827b240078132bc893963212871e2d7b6294c6a3.tar.gz re3-827b240078132bc893963212871e2d7b6294c6a3.tar.bz2 re3-827b240078132bc893963212871e2d7b6294c6a3.tar.lz re3-827b240078132bc893963212871e2d7b6294c6a3.tar.xz re3-827b240078132bc893963212871e2d7b6294c6a3.tar.zst re3-827b240078132bc893963212871e2d7b6294c6a3.zip |
Diffstat (limited to 'src/peds/Ped.cpp')
-rw-r--r-- | src/peds/Ped.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp index c675b7e5..165436b5 100644 --- a/src/peds/Ped.cpp +++ b/src/peds/Ped.cpp @@ -14611,7 +14611,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); @@ -14624,11 +14624,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; |