Skip to content

Commit 60df6ba

Browse files
authoredJul 18, 2024
Merge pull request #967 from SteelFill/light_reverse_fix
Fix AI Lights After Reversing Points
2 parents 3f93a37 + a799e20 commit 60df6ba

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed
 

‎Source/RunActivity/Viewer3D/Lights.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,7 @@ bool UpdateState()
278278

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.