Skip to content

Commit

Permalink
Fix raildriver not activated by button
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarBLG committed May 12, 2023
1 parent 2388225 commit d9d75f4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Source/RunActivity/Viewer3D/UserInputRailDriver.cs
Expand Up @@ -172,12 +172,15 @@ public void Update()
BailOff.IsDown = Percentage(readBuffer[5], calOff, calOn) > 50;
Wipers.Value = (int)(.01 * Percentage(readBuffer[6], wipers) + 2.5) == 1 ? 0 : 1;
Lights.Value = (int)(.01 * Percentage(readBuffer[7], headlight) + 2.5);

foreach (var buttonList in Commands.Values)
}
foreach (var command in Commands.Keys)
{
var buttonList = Commands[command];
foreach (var button in buttonList)
{
foreach (var button in buttonList)
if (button is RailDriverButton rd && (Active || command == UserCommand.GameExternalCabController))
{
if (button is RailDriverButton rd) rd.Update(readBuffer);
rd.Update(readBuffer);
}
}
}
Expand Down

0 comments on commit d9d75f4

Please sign in to comment.