Skip to content

Commit d9d75f4

Browse files
committed
Fix raildriver not activated by button
1 parent 2388225 commit d9d75f4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Source/RunActivity/Viewer3D/UserInputRailDriver.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,15 @@ public void Update()
172172
BailOff.IsDown = Percentage(readBuffer[5], calOff, calOn) > 50;
173173
Wipers.Value = (int)(.01 * Percentage(readBuffer[6], wipers) + 2.5) == 1 ? 0 : 1;
174174
Lights.Value = (int)(.01 * Percentage(readBuffer[7], headlight) + 2.5);
175-
176-
foreach (var buttonList in Commands.Values)
175+
}
176+
foreach (var command in Commands.Keys)
177+
{
178+
var buttonList = Commands[command];
179+
foreach (var button in buttonList)
177180
{
178-
foreach (var button in buttonList)
181+
if (button is RailDriverButton rd && (Active || command == UserCommand.GameExternalCabController))
179182
{
180-
if (button is RailDriverButton rd) rd.Update(readBuffer);
183+
rd.Update(readBuffer);
181184
}
182185
}
183186
}

0 commit comments

Comments
 (0)