@@ -917,8 +917,8 @@ function gearboxMogli:initFromXml(xmlFile,xmlString,xmlSource,serverAndClient,mo
917917 end
918918
919919 self .mrGbMS .ClutchTimeInc = Utils .getNoNil (getXMLFloat (xmlFile , xmlString .. " #clutchTimeIncreaseMs" ), clutchEngagingTimeMs )
920- self .mrGbMS .ClutchTimeDec = Utils .getNoNil (getXMLFloat (xmlFile , xmlString .. " #clutchTimeDecreaseMs" ), 0.50 * clutchEngagingTimeMs )
921- self .mrGbMS .ClutchShiftTime = Utils .getNoNil (getXMLFloat (xmlFile , xmlString .. " #clutchShiftingTimeMs" ), 0.25 * self .mrGbMS .ClutchTimeDec )
920+ self .mrGbMS .ClutchTimeDec = Utils .getNoNil (getXMLFloat (xmlFile , xmlString .. " #clutchTimeDecreaseMs" ), clutchEngagingTimeMs )
921+ self .mrGbMS .ClutchShiftTime = Utils .getNoNil (getXMLFloat (xmlFile , xmlString .. " #clutchShiftingTimeMs" ), 2 * self .mrGbMS .ClutchTimeDec )
922922 self .mrGbMS .ClutchTimeManual = math.max ( Utils .getNoNil (getXMLFloat (xmlFile , xmlString .. " #clutchTimeManualMs" ), self .mrGbMG .minClutchTimeManual ), self .mrGbMS .ClutchTimeInc )
923923 self .mrGbMS .ClutchCanOverheat = Utils .getNoNil (getXMLBool ( xmlFile , xmlString .. " #clutchCanOverheat" ), not self .mrGbMS .TorqueConverterOrHydro )
924924 self .mrGbMS .ClutchOverheatStartTime = Utils .getNoNil (getXMLFloat (xmlFile , xmlString .. " #clutchOverheatStartTimeMs" ), 5000 )
@@ -2511,9 +2511,9 @@ function gearboxMogli:update(dt)
25112511 end
25122512
25132513 local clutchSpeed = 1 / math.max ( self .mrGbMS .ClutchShiftTime , 1 )
2514- if not ( self :mrGbMGetAutoClutch () ) then
2515- clutchSpeed = math.max ( 0.002 , clutchSpeed )
2516- end
2514+ -- if not ( self:mrGbMGetAutoClutch() ) then
2515+ -- clutchSpeed = math.max( 0.002, clutchSpeed )
2516+ -- end
25172517
25182518 if gearboxMogli .mbIsInputPressed ( " gearboxMogliCLUTCH_3" ) then
25192519 self .mrGbML .oneButtonClutchTimer = g_currentMission .time + 100
@@ -5915,6 +5915,17 @@ function gearboxMogli:newUpdateWheelsPhysics( superFunc, dt, currentSpeed, acc,
59155915 end
59165916 end
59175917
5918+ do
5919+ local cs = currentSpeed * 3600
5920+ local sl = self :getSpeedLimit (true ) + gearboxMogli .extraSpeedLimit
5921+ if cs >= sl + 1 then
5922+ brakePedal = 1
5923+ brakeLights = true
5924+ elseif cs > sl then
5925+ brakePedal = math.max ( brakePedal , cs - sl )
5926+ end
5927+ end
5928+
59185929 self .motor :updateSpeedLimit ( dt )
59195930
59205931 if self .tempomatMogliV17 ~= nil
@@ -5923,9 +5934,19 @@ function gearboxMogli:newUpdateWheelsPhysics( superFunc, dt, currentSpeed, acc,
59235934 brakeLights = true
59245935 end
59255936
5937+ local lastRotatedTime = self .mrGbML .lastRotatedTime
5938+ self .mrGbML .lastRotatedTime = nil
5939+
59265940 if doHandbrake or self .mrGbMS .AutoHold or not ( self .isMotorStarted ) or g_currentMission .time < self .motorStartTime then
59275941 -- hand brake
5928- if math.abs (self .rotatedTime ) < 0.01 or self .articulatedAxis == nil then
5942+ if self .articulatedAxis ~= nil then
5943+ if lastRotatedTime == nil then
5944+ brakePedal = 1
5945+ else
5946+ brakePedal = 1 - 0.5 * ( lastRotatedTime - self .rotatedTime )
5947+ end
5948+ self .mrGbML .lastRotatedTime = self .rotatedTime
5949+ else
59295950 brakePedal = 1
59305951 end
59315952 elseif acceleration < 0 then
@@ -5941,11 +5962,14 @@ function gearboxMogli:newUpdateWheelsPhysics( superFunc, dt, currentSpeed, acc,
59415962
59425963
59435964 if ( self :mrGbMGetAutoHold () or ( self :mrGbMGetAutoClutch () and acceleration > 0.001 ) )
5944- and ( ( self .movingDirection * currentSpeed > 2.7777777778e-4 and self .mrGbMS .ReverseActive )
5945- or ( self .movingDirection * currentSpeed < - 2.7777777778e-4 and not ( self .mrGbMS .ReverseActive ) ) ) then
5946- -- wrong direction
5947- brakePedal = 1
5948- brakeLights = true
5965+ and ( ( self .movingDirection * currentSpeed > 0 and self .mrGbMS .ReverseActive )
5966+ or ( self .movingDirection * currentSpeed < 0 and not ( self .mrGbMS .ReverseActive ) ) ) then
5967+ -- wrong direction
5968+ local b = math.min ( 1 , 1800 * math.abs ( currentSpeed ) )
5969+ if b >= 0.5 then
5970+ brakeLights = true
5971+ end
5972+ brakePedal = math.max ( b , brakePedal )
59495973 end
59505974
59515975 if self :mrGbMGetAutoHold ()
@@ -5981,7 +6005,7 @@ function gearboxMogli:newUpdateWheelsPhysics( superFunc, dt, currentSpeed, acc,
59816005
59826006 brakePedal = math.max ( brakePedal , brakeForce )
59836007
5984- if self .motor .clutchPercent < gearboxMogli .minClutchPercent + gearboxMogli . minClutchPercent then
6008+ if self .motor .clutchPercent < gearboxMogli .minClutchPercent then
59856009 c = 0
59866010 else
59876011 local cp = self .motor .clutchPercent
@@ -7930,7 +7954,7 @@ function gearboxMogliMotor:mrGbMUpdateGear( accelerationPedal )
79307954 self .vehicle :mrGbMDoGearShift ()
79317955 self .vehicle .mrGbML .gearShiftingNeeded = 0
79327956
7933- elseif not ( self .vehicle :mrGbMGetAutoClutch () ) and self .vehicle .mrGbMS .ManualClutch < self . vehicle . mrGbMS . MinClutchPercent + 0.1 then
7957+ elseif not ( self .vehicle :mrGbMGetAutoClutch () ) and self .vehicle .mrGbMS .ManualClutch < gearboxMogli . minClutchPercent then
79347958 -- **********************************************************************************************************
79357959 -- manual clutch pressed
79367960 self .noTransmission = true
0 commit comments