diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-04 18:52:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-04 18:52:26 +0200 |
commit | 131e8af174a106e2bf98da8ef3ab7ba0bb55e09e (patch) | |
tree | b59b5a35fb3b7c596b0501152e23f537727aaf01 /src/control/CarCtrl.cpp | |
parent | Merge pull request #507 from aap/master (diff) | |
parent | deny coach in crusher (diff) | |
download | re3-131e8af174a106e2bf98da8ef3ab7ba0bb55e09e.tar re3-131e8af174a106e2bf98da8ef3ab7ba0bb55e09e.tar.gz re3-131e8af174a106e2bf98da8ef3ab7ba0bb55e09e.tar.bz2 re3-131e8af174a106e2bf98da8ef3ab7ba0bb55e09e.tar.lz re3-131e8af174a106e2bf98da8ef3ab7ba0bb55e09e.tar.xz re3-131e8af174a106e2bf98da8ef3ab7ba0bb55e09e.tar.zst re3-131e8af174a106e2bf98da8ef3ab7ba0bb55e09e.zip |
Diffstat (limited to '')
-rw-r--r-- | src/control/CarCtrl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp index c3fb5409..bfa33f27 100644 --- a/src/control/CarCtrl.cpp +++ b/src/control/CarCtrl.cpp @@ -422,8 +422,11 @@ CCarCtrl::GenerateOneRandomCar() #ifdef FIX_BUGS /* Casting timer to float is very unwanted. In this case it's not awful */ /* but in CAutoPilot::ModifySpeed it can even cause crashes (see SilentPatch). */ + + /* Second fix: adding 0.5f is a mistake. It should be between 0 and 1. It was fixed in SA.*/ + /* It is also correct in CAutoPilot::ModifySpeed. */ pCar->AutoPilot.m_nTimeEnteredCurve = CTimer::GetTimeInMilliseconds() - - (uint32)((0.5f + positionBetweenNodes) * pCar->AutoPilot.m_nTimeToSpendOnCurrentCurve); + (uint32)(positionBetweenNodes * pCar->AutoPilot.m_nTimeToSpendOnCurrentCurve); #else pCar->AutoPilot.m_nTimeEnteredCurve = CTimer::GetTimeInMilliseconds() - (0.5f + positionBetweenNodes) * pCar->AutoPilot.m_nTimeToSpendOnCurrentCurve; |