Skip to content

Commit aa72c13

Browse files
committed
Fix wrong detection of non-smooth controllers
1 parent 7fc8de1 commit aa72c13

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/CruiseControl.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ public void SpeedRegulatorMaxForceStartToZero(float? target)
10461046
return;
10471047

10481048
MaxForceSelectorController.StartDecrease(target, true);
1049-
if (MaxForceSelectorController.NotchCount() <= 0) Locomotive.SignalEvent(Common.Event.CruiseControlMaxForce);
1049+
if (MaxForceSelectorController.NotchCount() <= 1) Locomotive.SignalEvent(Common.Event.CruiseControlMaxForce);
10501050
}
10511051
public void SpeedRegulatorMaxForceChangeByMouse(float value)
10521052
{
@@ -1198,7 +1198,7 @@ public void SpeedSelectorIncreaseStep()
11981198
if (time >= selectedSpeedLeverHoldTime && time < selectedSpeedLeverHoldTime + SpeedSelectorStepTimeSeconds) return;
11991199
selectedSpeedLeverHoldTime = time;
12001200

1201-
if (SpeedSelectorController.NotchCount() > 0)
1201+
if (SpeedSelectorController.NotchCount() > 1)
12021202
{
12031203
SpeedSelectorController.StartIncrease();
12041204
SpeedSelectorController.StopIncrease();
@@ -1222,7 +1222,7 @@ public void SpeedSelectorDecreaseStep()
12221222
selectedSpeedLeverHoldTime = time;
12231223

12241224
float speed = ControllerValueToSelectedSpeedMpS(SpeedSelectorController.CurrentValue) - SpeedRegulatorNominalSpeedStepMpS;
1225-
if (SpeedSelectorController.NotchCount() > 0)
1225+
if (SpeedSelectorController.NotchCount() > 1)
12261226
{
12271227
SpeedSelectorController.StartDecrease();
12281228
SpeedSelectorController.StopDecrease();

0 commit comments

Comments
 (0)