From 0ec9d4b93c382e31f4b235cd1828103f96a9ab34 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 60bba1dc..aa6a386c 100644 --- a/Driver.cpp +++ b/Driver.cpp @@ -6060,11 +6060,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) ) ) {