summaryrefslogtreecommitdiffstats
path: root/src/control/CarCtrl.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-02-01 17:40:54 +0100
committerSergeanur <s.anureev@yandex.ua>2020-02-01 17:40:54 +0100
commit3d69148497d9d6415b2a67348fac4531a5952adf (patch)
tree870248f43478e8f768271f41672b3de4d6f58e92 /src/control/CarCtrl.cpp
parentFix damage bar assert crash (diff)
downloadre3-3d69148497d9d6415b2a67348fac4531a5952adf.tar
re3-3d69148497d9d6415b2a67348fac4531a5952adf.tar.gz
re3-3d69148497d9d6415b2a67348fac4531a5952adf.tar.bz2
re3-3d69148497d9d6415b2a67348fac4531a5952adf.tar.lz
re3-3d69148497d9d6415b2a67348fac4531a5952adf.tar.xz
re3-3d69148497d9d6415b2a67348fac4531a5952adf.tar.zst
re3-3d69148497d9d6415b2a67348fac4531a5952adf.zip
Diffstat (limited to 'src/control/CarCtrl.cpp')
-rw-r--r--src/control/CarCtrl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index 209a5e21..ab7a4aa1 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -2421,8 +2421,8 @@ void CCarCtrl::SteerAIBoatWithPhysicsHeadingForTarget(CBoat* pBoat, float target
float angleForward = CGeneral::GetATanOfXY(forward.x, forward.y);
float angleDiff = LimitRadianAngle(angleToTarget - angleForward);
angleDiff = min(DEFAULT_MAX_STEER_ANGLE, max(-DEFAULT_MAX_STEER_ANGLE, angleDiff));
- float currentSpeed = pBoat->GetMoveSpeed().Magnitude(); // +0.0f for some reason
- float speedDiff = pBoat->AutoPilot.m_nCruiseSpeed - currentSpeed;
+ float currentSpeed = pBoat->GetMoveSpeed().Magnitude2D(); // +0.0f for some reason
+ float speedDiff = pBoat->AutoPilot.m_nCruiseSpeed - currentSpeed * 60.0f;
if (speedDiff > 0.0f){
float accRemaining = speedDiff / pBoat->AutoPilot.m_nCruiseSpeed;
*pAccel = (accRemaining > 0.25f) ? 1.0f : 1.0f - (0.25f - accRemaining) * 4.0f;