From a799e20daecc728582aba6d8e25cd5d03cdb82d0 Mon Sep 17 00:00:00 2001 From: Phillip Schlichting Date: Sun, 7 Jul 2024 18:49:33 -0500 Subject: [PATCH] Remove lighting check for AI train lead locomotive as it produces different behavior from previous versions --- Source/RunActivity/Viewer3D/Lights.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Source/RunActivity/Viewer3D/Lights.cs b/Source/RunActivity/Viewer3D/Lights.cs index 4ee20bc93..ae905e2be 100644 --- a/Source/RunActivity/Viewer3D/Lights.cs +++ b/Source/RunActivity/Viewer3D/Lights.cs @@ -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