Skip to content

Commit 492795a

Browse files
committed
Do not use discrete selector if step is 0
1 parent e813c42 commit 492795a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ public void Initialize()
511511
else if (MaxForceSelectorController == null)
512512
{
513513
var notches = new List<MSTSNotch>();
514-
if (MaxForceSelectorIsDiscrete)
514+
if (MaxForceSelectorIsDiscrete && SpeedRegulatorMaxForceSteps > 0)
515515
{
516516
float numNotches = SpeedRegulatorMaxForceSteps;
517517
for (int i=DisableZeroForceStep ? 1 : 0; i<=numNotches; i++)
@@ -538,7 +538,7 @@ public void Initialize()
538538
else if (SpeedSelectorController == null)
539539
{
540540
var notches = new List<MSTSNotch>();
541-
if (SpeedSelectorIsDiscrete)
541+
if (SpeedSelectorIsDiscrete && SpeedRegulatorNominalSpeedStepMpS > 0)
542542
{
543543
if (!DisableZeroSelectedSpeedStep) notches.Add(new MSTSNotch(0, false, 0));
544544
if (MinimumSpeedForCCEffectMpS > 0) notches.Add(new MSTSNotch(float.Epsilon, false, 0));

0 commit comments

Comments
 (0)