summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2021-01-11 18:51:18 +0100
committerNikolay Korolev <nickvnuk@gmail.com>2021-01-11 18:51:18 +0100
commitc7052b3d6f39264177e5af9c8ea2290d49ceaf72 (patch)
tree65b1e072c5bb6897ddf840daa10e46b215a9d20b /src/control
parentfixes (diff)
downloadre3-c7052b3d6f39264177e5af9c8ea2290d49ceaf72.tar
re3-c7052b3d6f39264177e5af9c8ea2290d49ceaf72.tar.gz
re3-c7052b3d6f39264177e5af9c8ea2290d49ceaf72.tar.bz2
re3-c7052b3d6f39264177e5af9c8ea2290d49ceaf72.tar.lz
re3-c7052b3d6f39264177e5af9c8ea2290d49ceaf72.tar.xz
re3-c7052b3d6f39264177e5af9c8ea2290d49ceaf72.tar.zst
re3-c7052b3d6f39264177e5af9c8ea2290d49ceaf72.zip
Diffstat (limited to 'src/control')
-rw-r--r--src/control/CarCtrl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index 1023f2a3..6f47db05 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -2930,7 +2930,7 @@ void CCarCtrl::SteerAICarWithPhysicsHeadingForTarget(CVehicle* pVehicle, CPhysic
*pHandbrake = true;
float maxAngle = FindMaxSteerAngle(pVehicle);
steerAngle = Min(maxAngle, Max(-maxAngle, steerAngle));
- float speedMultiplier = FindSpeedMultiplier(angleToTarget - angleForward,
+ float speedMultiplier = FindSpeedMultiplier(CGeneral::GetATanOfXY(targetX - pVehicle->GetPosition().x, targetY - pVehicle->GetPosition().y) - angleForward,
MIN_ANGLE_FOR_SPEED_LIMITING, MAX_ANGLE_FOR_SPEED_LIMITING, MIN_LOWERING_SPEED_COEFFICIENT);
float speedTarget = pVehicle->AutoPilot.m_nCruiseSpeed * speedMultiplier;
float currentSpeed = pVehicle->GetMoveSpeed().Magnitude() * GAME_SPEED_TO_CARAI_SPEED;