summaryrefslogtreecommitdiffstats
path: root/src/control/CarCtrl.cpp
diff options
context:
space:
mode:
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;