Skip to content

Commit

Permalink
Fix small initialization error
Browse files Browse the repository at this point in the history
  • Loading branch information
SteelFill authored Feb 28, 2024
1 parent 41f2b69 commit 644844a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Source/RunActivity/Viewer3D/Lights.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,11 @@ public LightViewer(Viewer viewer, TrainCar car, TrainCarViewer carViewer)
if (light.ShapeIndex != -1)
{
if (light.ShapeIndex < 0 || light.ShapeIndex >= (CarViewer as MSTSWagonViewer).TrainCarShape.XNAMatrices.Count())
{
Trace.TraceWarning("Light in car {0} has invalid shape index defined, shape index {1} does not exist",
(Car as MSTSWagon).WagFilePath, light.ShapeIndex);
light.ShapeIndex = 0;
light.ShapeIndex = 0;
}
}
else
{
Expand Down

0 comments on commit 644844a

Please sign in to comment.