diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-20 22:47:44 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-20 22:47:44 +0200 |
commit | 0085ed894fe5fb5241c978c891ba4eadf4c02809 (patch) | |
tree | 6c8ac014bb59253c909f9e29f8b6277a0aa25358 /src/control/CarCtrl.cpp | |
parent | Merge remote-tracking branch 'upstream/miami' into miami (diff) | |
download | re3-0085ed894fe5fb5241c978c891ba4eadf4c02809.tar re3-0085ed894fe5fb5241c978c891ba4eadf4c02809.tar.gz re3-0085ed894fe5fb5241c978c891ba4eadf4c02809.tar.bz2 re3-0085ed894fe5fb5241c978c891ba4eadf4c02809.tar.lz re3-0085ed894fe5fb5241c978c891ba4eadf4c02809.tar.xz re3-0085ed894fe5fb5241c978c891ba4eadf4c02809.tar.zst re3-0085ed894fe5fb5241c978c891ba4eadf4c02809.zip |
Diffstat (limited to 'src/control/CarCtrl.cpp')
-rw-r--r-- | src/control/CarCtrl.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp index 920fba81..b250cb97 100644 --- a/src/control/CarCtrl.cpp +++ b/src/control/CarCtrl.cpp @@ -2995,7 +2995,9 @@ void CCarCtrl::FindLinksToGoWithTheseNodes(CVehicle* pVehicle) CPathNode* pNode = &ThePaths.m_pathNodes[node]; if (node == pVehicle->AutoPilot.m_nNextRouteNode) continue; - float dist = CCollision::DistToLine(&pCurNode->GetPosition(), &pNode->GetPosition(), &pVehicle->GetPosition()); + CVector vCurPos = pCurNode->GetPosition(); + CVector vNextPos = pNode->GetPosition(); + float dist = CCollision::DistToLine(&vCurPos, &vNextPos, &pVehicle->GetPosition()); if (dist < md) { md = dist; closestLink = curLink; |