diff options
author | aap <aap@papnet.eu> | 2020-12-09 09:55:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-09 09:55:50 +0100 |
commit | ccbbde549e81a7d0e71228ad5c244da6c8bd287f (patch) | |
tree | b05d46740914289c3e713579716ef7cfa0068244 /src/control/CarCtrl.cpp | |
parent | Vehicle cam object collision fix (diff) | |
parent | sync with upstream (diff) | |
download | re3-ccbbde549e81a7d0e71228ad5c244da6c8bd287f.tar re3-ccbbde549e81a7d0e71228ad5c244da6c8bd287f.tar.gz re3-ccbbde549e81a7d0e71228ad5c244da6c8bd287f.tar.bz2 re3-ccbbde549e81a7d0e71228ad5c244da6c8bd287f.tar.lz re3-ccbbde549e81a7d0e71228ad5c244da6c8bd287f.tar.xz re3-ccbbde549e81a7d0e71228ad5c244da6c8bd287f.tar.zst re3-ccbbde549e81a7d0e71228ad5c244da6c8bd287f.zip |
Diffstat (limited to 'src/control/CarCtrl.cpp')
-rw-r--r-- | src/control/CarCtrl.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp index 3d52a0b0..d4691e2b 100644 --- a/src/control/CarCtrl.cpp +++ b/src/control/CarCtrl.cpp @@ -506,6 +506,10 @@ CCarCtrl::GenerateOneRandomCar() CCarPathLink* pCurrentLink = &ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nCurrentPathNodeInfo]; CCarPathLink* pNextLink = &ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nNextPathNodeInfo]; + float currentPathLinkForwardX = pVehicle->AutoPilot.m_nCurrentDirection * ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nCurrentPathNodeInfo].GetDirX(); + float currentPathLinkForwardY = pVehicle->AutoPilot.m_nCurrentDirection * ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nCurrentPathNodeInfo].GetDirY(); + float nextPathLinkForwardX = pVehicle->AutoPilot.m_nNextDirection * ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nNextPathNodeInfo].GetDirX(); + float nextPathLinkForwardY = pVehicle->AutoPilot.m_nNextDirection * ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nNextPathNodeInfo].GetDirY(); CVector positionOnCurrentLinkIncludingLane( pCurrentLink->GetX() + ((pVehicle->AutoPilot.m_nCurrentLane + pCurrentLink->OneWayLaneOffset()) * LANE_WIDTH) * currentPathLinkForwardY, pCurrentLink->GetY() - ((pVehicle->AutoPilot.m_nCurrentLane + pCurrentLink->OneWayLaneOffset()) * LANE_WIDTH) * currentPathLinkForwardX, |