From a027192f00e6fdf2a589eaae736f252de839fac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=B3lik=20Uszasty?= Date: Sat, 12 Oct 2019 19:59:31 +0200 Subject: [PATCH] AI allows for small overspeeding while vehicle's speed control is active --- Driver.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Driver.cpp b/Driver.cpp index d2098ebc..1fce4918 100644 --- a/Driver.cpp +++ b/Driver.cpp @@ -6088,11 +6088,12 @@ TController::UpdateSituation(double dt) { // zmniejszanie predkosci // margines dla prędkości jest doliczany tylko jeśli oczekiwana prędkość jest większa od 5km/h if( false == TestFlag( iDrivigFlags, movePress ) ) { + double SpeedCtrlMargin = (mvControlling->SpeedCtrlUnit.IsActive && VelDesired > 5) ? 3 : 0; // jeśli nie dociskanie if( AccDesired < -0.05 ) { ZeroSpeed(); } - else if( ( vel > VelDesired ) + else if( ( vel > VelDesired + SpeedCtrlMargin) || ( fAccGravity < -0.01 ? AccDesired < 0.0 : (AbsAccS > AccDesired && AccDesired < 0.75) ) ) {