summaryrefslogtreecommitdiffstats
path: root/src/control/AutoPilot.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-04-10 18:36:39 +0200
committeraap <aap@papnet.eu>2020-04-10 18:36:39 +0200
commitc5d61392ead394a3d6a1e2832c7d9f0ccf951ad3 (patch)
treedd8186d8f12e842649ba233274ad1916ed5b1343 /src/control/AutoPilot.cpp
parentdisabling the code that freezes gang members (diff)
downloadre3-c5d61392ead394a3d6a1e2832c7d9f0ccf951ad3.tar
re3-c5d61392ead394a3d6a1e2832c7d9f0ccf951ad3.tar.gz
re3-c5d61392ead394a3d6a1e2832c7d9f0ccf951ad3.tar.bz2
re3-c5d61392ead394a3d6a1e2832c7d9f0ccf951ad3.tar.lz
re3-c5d61392ead394a3d6a1e2832c7d9f0ccf951ad3.tar.xz
re3-c5d61392ead394a3d6a1e2832c7d9f0ccf951ad3.tar.zst
re3-c5d61392ead394a3d6a1e2832c7d9f0ccf951ad3.zip
Diffstat (limited to '')
-rw-r--r--src/control/AutoPilot.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/control/AutoPilot.cpp b/src/control/AutoPilot.cpp
index 70099291..b5bca21d 100644
--- a/src/control/AutoPilot.cpp
+++ b/src/control/AutoPilot.cpp
@@ -12,17 +12,17 @@ void CAutoPilot::ModifySpeed(float speed)
float positionBetweenNodes = (float)(CTimer::GetTimeInMilliseconds() - m_nTimeEnteredCurve) / m_nTimeToSpendOnCurrentCurve;
CCarPathLink* pCurrentLink = &ThePaths.m_carPathLinks[m_nCurrentPathNodeInfo];
CCarPathLink* pNextLink = &ThePaths.m_carPathLinks[m_nNextPathNodeInfo];
- float currentPathLinkForwardX = m_nCurrentDirection * ThePaths.m_carPathLinks[m_nCurrentPathNodeInfo].dirX;
- float currentPathLinkForwardY = m_nCurrentDirection * ThePaths.m_carPathLinks[m_nCurrentPathNodeInfo].dirY;
- float nextPathLinkForwardX = m_nNextDirection * ThePaths.m_carPathLinks[m_nNextPathNodeInfo].dirX;
- float nextPathLinkForwardY = m_nNextDirection * ThePaths.m_carPathLinks[m_nNextPathNodeInfo].dirY;
+ float currentPathLinkForwardX = m_nCurrentDirection * ThePaths.m_carPathLinks[m_nCurrentPathNodeInfo].dir.x;
+ float currentPathLinkForwardY = m_nCurrentDirection * ThePaths.m_carPathLinks[m_nCurrentPathNodeInfo].dir.y;
+ float nextPathLinkForwardX = m_nNextDirection * ThePaths.m_carPathLinks[m_nNextPathNodeInfo].dir.x;
+ float nextPathLinkForwardY = m_nNextDirection * ThePaths.m_carPathLinks[m_nNextPathNodeInfo].dir.y;
CVector positionOnCurrentLinkIncludingLane(
- pCurrentLink->posX + ((m_nCurrentLane + 0.5f) * LANE_WIDTH) * currentPathLinkForwardY,
- pCurrentLink->posY - ((m_nCurrentLane + 0.5f) * LANE_WIDTH) * currentPathLinkForwardX,
+ pCurrentLink->pos.x + ((m_nCurrentLane + 0.5f) * LANE_WIDTH) * currentPathLinkForwardY,
+ pCurrentLink->pos.y - ((m_nCurrentLane + 0.5f) * LANE_WIDTH) * currentPathLinkForwardX,
0.0f);
CVector positionOnNextLinkIncludingLane(
- pNextLink->posX + ((m_nNextLane + 0.5f) * LANE_WIDTH) * nextPathLinkForwardY,
- pNextLink->posY - ((m_nNextLane + 0.5f) * LANE_WIDTH) * nextPathLinkForwardX,
+ pNextLink->pos.x + ((m_nNextLane + 0.5f) * LANE_WIDTH) * nextPathLinkForwardY,
+ pNextLink->pos.y - ((m_nNextLane + 0.5f) * LANE_WIDTH) * nextPathLinkForwardX,
0.0f);
m_nTimeToSpendOnCurrentCurve = CCurves::CalcSpeedScaleFactor(
&positionOnCurrentLinkIncludingLane,