File tree Expand file tree Collapse file tree 1 file changed +1
-1
lines changed
Source/RunActivity/Viewer3D Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Original file line number Diff line number Diff line change @@ -347,7 +347,7 @@ bool UpdateState()
347
347
bool newLeftDoorOpen = ! Car . Lights . IgnoredConditions [ 11 ] && Car . Train ? . DoorState ( DoorSide . Left ) != DoorState . Closed ;
348
348
bool newRightDoorOpen = ! Car . Lights . IgnoredConditions [ 11 ] && Car . Train ? . DoorState ( DoorSide . Right ) != DoorState . Closed ;
349
349
// AI trains don't have a lead locomotive, but the upcoming lighting calculations want a lead locomotive, try to determine a lead locomotive to use
350
- if ( leadLocomotive == null )
350
+ if ( leadLocomotive == null && Car . Train != null )
351
351
{
352
352
// If first car is flipped, the 'lead' vehicle is actually at the rear
353
353
if ( Car . Train . FirstCar . Flipped && Car . Train . LastCar is MSTSLocomotive )
You can’t perform that action at this time.
0 commit comments