Skip to content

Commit c2ac0c5

Browse files
authored
Merge pull request #606 from Csantucci/fix-initialize-moving
Bug fix for http://www.elvastower.com/forums/index.php?/topic/36021-crash-on-switching-to-autopilot/#entry282465
2 parents b930903 + 4042b59 commit c2ac0c5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Controllers/MSTSBrakeController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ public override void Initialize()
5959
public override void InitializeMoving()
6060
{
6161
NotchController.SetValue(0);
62-
NotchController.CurrentNotch = 0;
62+
if (NotchController.NotchCount() > 0) NotchController.CurrentNotch = 0;
63+
else NotchController.CurrentNotch = -1;
6364
}
6465

6566
public override float Update(float elapsedSeconds)

0 commit comments

Comments
 (0)