@@ -4232,23 +4232,18 @@ public void StartThrottleToZero(float? target)
42324232 /// whether it is used for cruise control or not
42334233 /// </summary>
42344234 /// <param name="intermediateValue">Whather asking for intermediate (for mouse operation) or notched (for displaying) value.</param>
4235- /// <returns>Combined position into 0-1 range</returns>
4236- public float GetThrottleHandleValue ( float data )
4235+ /// <returns>Position into 0-1 range</returns>
4236+ public float GetThrottleHandleValue ( bool intermediateValue )
42374237 {
42384238 if ( CruiseControl ? . SpeedRegMode == CruiseControl . SpeedRegulatorMode . Auto && CruiseControl . SelectedMaxAccelerationPercent != 0
42394239 && CruiseControl . HasIndependentThrottleDynamicBrakeLever )
4240- return ThrottleController . CurrentValue ;
4240+ return intermediateValue ? ThrottleController . CurrentValue : ThrottleController . IntermediateValue ;
42414241 if ( CruiseControl ? . SpeedRegMode == CruiseControl . SpeedRegulatorMode . Auto && CruiseControl . UseThrottleAsForceSelector )
42424242 return CruiseControl . SelectedMaxAccelerationPercent / 100 ;
42434243 if ( CruiseControl ? . SpeedRegMode == CruiseControl . SpeedRegulatorMode . Auto && CruiseControl . UseThrottleAsSpeedSelector )
42444244 return CruiseControl . SelectedSpeedMpS / MaxSpeedMpS ;
42454245
4246-
4247- if ( CruiseControl == null || CruiseControl . SpeedRegMode == CruiseControl . SpeedRegulatorMode . Manual )
4248- return data ;
4249- else
4250- return ThrottleController . CurrentValue ;
4251-
4246+ return intermediateValue ? ThrottleController . CurrentValue : ThrottleController . IntermediateValue ;
42524247 }
42534248
42544249 #endregion
@@ -5777,7 +5772,7 @@ public virtual float GetDataOf(CabViewControl cvc)
57775772 case CABViewControlTypes . THROTTLE :
57785773 {
57795774 if ( CruiseControl != null && CruiseControl . SkipThrottleDisplay ) break ;
5780- data = GetThrottleHandleValue ( ( Train . TrainType == Train . TRAINTYPE . AI_PLAYERHOSTING || Train . Autopilot ) ? ThrottlePercent / 100f : LocalThrottlePercent / 100f ) ;
5775+ data = GetThrottleHandleValue ( false ) ;
57815776 break ;
57825777 }
57835778 case CABViewControlTypes . THROTTLE_DISPLAY :
@@ -5872,10 +5867,13 @@ public virtual float GetDataOf(CabViewControl cvc)
58725867 break ;
58735868 }
58745869 case CABViewControlTypes . DYNAMIC_BRAKE :
5870+ {
5871+ data = DynamicBrakeController ? . CurrentValue ?? 0 ;
5872+ break ;
5873+ }
58755874 case CABViewControlTypes . DYNAMIC_BRAKE_DISPLAY :
5876- //case CABViewControlTypes.CP_HANDLE:
58775875 {
5878- data = DynamicBrakePercent / 100f ;
5876+ data = ( Train . TrainType == Train . TRAINTYPE . AI_PLAYERHOSTING || Train . Autopilot ) ? DynamicBrakePercent / 100 : LocalDynamicBrakePercent / 100 ;
58795877 break ;
58805878 }
58815879 case CABViewControlTypes . WIPERS :
0 commit comments