summaryrefslogtreecommitdiffstats
path: root/src/control/CarCtrl.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-20 22:47:44 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-20 22:47:44 +0200
commit0085ed894fe5fb5241c978c891ba4eadf4c02809 (patch)
tree6c8ac014bb59253c909f9e29f8b6277a0aa25358 /src/control/CarCtrl.cpp
parentMerge remote-tracking branch 'upstream/miami' into miami (diff)
downloadre3-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.cpp4
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;