diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2021-01-11 18:51:18 +0100 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2021-01-11 18:53:03 +0100 |
commit | 31dd13507549dc0a4a8c763654f1c55725048a25 (patch) | |
tree | 7206737268c1b388ee59fe5aa0f75cc4a5ce5c29 /src/control | |
parent | fixes (diff) | |
download | re3-31dd13507549dc0a4a8c763654f1c55725048a25.tar re3-31dd13507549dc0a4a8c763654f1c55725048a25.tar.gz re3-31dd13507549dc0a4a8c763654f1c55725048a25.tar.bz2 re3-31dd13507549dc0a4a8c763654f1c55725048a25.tar.lz re3-31dd13507549dc0a4a8c763654f1c55725048a25.tar.xz re3-31dd13507549dc0a4a8c763654f1c55725048a25.tar.zst re3-31dd13507549dc0a4a8c763654f1c55725048a25.zip |
Diffstat (limited to '')
-rw-r--r-- | src/control/CarCtrl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp index cb4229eb..edf367b8 100644 --- a/src/control/CarCtrl.cpp +++ b/src/control/CarCtrl.cpp @@ -2415,7 +2415,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; |