Skip to content

Commit e6405b0

Browse files
committed
Fix out of range index in 3D cabs
1 parent 6a56c0d commit e6405b0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Source/RunActivity/Viewer3D/Viewer.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,13 +1622,15 @@ public void ChangeCab()
16221622
PlayerLocomotiveViewer = World.Trains.GetViewer(Simulator.PlayerLocomotive);
16231623
if (PlayerLocomotiveViewer is MSTSLocomotiveViewer && (PlayerLocomotiveViewer as MSTSLocomotiveViewer)._hasCabRenderer)
16241624
AdjustCabHeight(DisplaySize.X, DisplaySize.Y);
1625+
1626+
ThreeDimCabCamera.ChangeCab(Simulator.PlayerLocomotive);
1627+
HeadOutForwardCamera.ChangeCab(Simulator.PlayerLocomotive);
1628+
HeadOutBackCamera.ChangeCab(Simulator.PlayerLocomotive);
1629+
16251630
if (!Simulator.PlayerLocomotive.HasFront3DCab && !Simulator.PlayerLocomotive.HasRear3DCab)
16261631
CabCamera.Activate(); // If you need anything else here the cameras should check for it.
16271632
else ThreeDimCabCamera.Activate();
16281633
SetCommandReceivers();
1629-
ThreeDimCabCamera.ChangeCab(Simulator.PlayerLocomotive);
1630-
HeadOutForwardCamera.ChangeCab(Simulator.PlayerLocomotive);
1631-
HeadOutBackCamera.ChangeCab(Simulator.PlayerLocomotive);
16321634
if (MPManager.IsMultiPlayer())
16331635
MPManager.LocoChange(Simulator.PlayerLocomotive.Train, Simulator.PlayerLocomotive);
16341636
Simulator.Confirmer.Confirm(CabControl.ChangeCab, CabSetting.On);

0 commit comments

Comments
 (0)