Skip to content

Commit 375f798

Browse files
authored
Merge pull request #941 from SteelFill/lights_bugfix
AI Penalty Lights Fix
2 parents bead376 + 50378f6 commit 375f798

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Source/RunActivity/Viewer3D/Lights.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,13 @@ bool UpdateState()
295295
bool newCarIsFirst = !Car.Lights.IgnoredConditions[1] && (locomotiveFlipped ^ locomotiveReverseCab ? Car.Train?.LastCar : Car.Train?.FirstCar) == Car;
296296
bool newCarIsLast = !Car.Lights.IgnoredConditions[1] && (locomotiveFlipped ^ locomotiveReverseCab ? Car.Train?.FirstCar : Car.Train?.LastCar) == Car;
297297
// Penalty
298-
bool newPenalty = !Car.Lights.IgnoredConditions[2] && leadLocomotive != null && leadLocomotive.TrainBrakeController.EmergencyBraking;
298+
bool newPenalty = !Car.Lights.IgnoredConditions[2] && Car.Train.TrainType != Train.TRAINTYPE.AI
299+
&& leadLocomotive != null && leadLocomotive.TrainBrakeController.EmergencyBraking;
299300
// Control
300301
bool newCarIsPlayer = !Car.Lights.IgnoredConditions[3] && Car.Train != null && (Car.Train == Viewer.PlayerTrain || Car.Train.TrainType == Train.TRAINTYPE.REMOTE);
301302
// Service - if a player or AI train, then will considered to be in servie, loose consists will not be considered to be in service.
302-
bool newCarInService = !Car.Lights.IgnoredConditions[4] && Car.Train != null && (Car.Train == Viewer.PlayerTrain || Car.Train.TrainType == Train.TRAINTYPE.REMOTE || Car.Train.TrainType == Train.TRAINTYPE.AI);
303+
bool newCarInService = !Car.Lights.IgnoredConditions[4] && Car.Train != null
304+
&& (Car.Train == Viewer.PlayerTrain || Car.Train.TrainType == Train.TRAINTYPE.REMOTE || Car.Train.TrainType == Train.TRAINTYPE.AI);
303305
// Time of day
304306
bool newIsDay = false;
305307
if (!Car.Lights.IgnoredConditions[5])

0 commit comments

Comments
 (0)