Skip to content

Commit

Permalink
Merge pull request #967 from SteelFill/light_reverse_fix
Browse files Browse the repository at this point in the history
Fix AI Lights After Reversing Points
  • Loading branch information
SteelFill authored Jul 18, 2024
2 parents 3f93a37 + a799e20 commit 60df6ba
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Source/RunActivity/Viewer3D/Lights.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,7 @@ bool UpdateState()

Debug.Assert(Viewer.PlayerTrain.LeadLocomotive == Viewer.PlayerLocomotive ||Viewer.PlayerTrain.TrainType == Train.TRAINTYPE.AI_PLAYERHOSTING ||
Viewer.PlayerTrain.TrainType == Train.TRAINTYPE.REMOTE || Viewer.PlayerTrain.TrainType == Train.TRAINTYPE.STATIC, "PlayerTrain.LeadLocomotive must be PlayerLocomotive.");
var leadLocomotiveCar = Car.Train?.LeadLocomotive;
if (leadLocomotiveCar == null && Car.Train?.Cars[0] is MSTSLocomotive) // AI trains have no lead locomotive
leadLocomotiveCar = Car.Train.Cars[0];
var leadLocomotiveCar = Car.Train?.LeadLocomotive; // Note: Will return null for AI trains, this is intended behavior
var leadLocomotive = leadLocomotiveCar as MSTSLocomotive;

// There are a lot of conditions now! IgnoredConditions[] stores which conditions are ignored, allowing shortcutting of many of these calculations
Expand Down

0 comments on commit 60df6ba

Please sign in to comment.