Skip to content

Commit 736c3f5

Browse files
committed
Fix bug when switching from cab camera to camera 2.
1 parent 251a677 commit 736c3f5

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Source/RunActivity/Viewer3D/Cameras.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,9 +1083,6 @@ protected override void OnActivate(bool sameCamera)
10831083
isVisibleTrainCarViewerOrWebpage = (Viewer.TrainCarOperationsWindow.Visible && !Viewer.TrainCarOperationsViewerWindow.Visible) || Viewer.TrainCarOperationsViewerWindow.Visible || (Viewer.TrainCarOperationsWebpage?.Connections > 0 && Viewer.TrainCarOperationsWebpage.TrainCarSelected);
10841084
}
10851085

1086-
// Update the camera view
1087-
oldCarPosition = oldCarPosition == 0 && carPosition == 0 ? -1 : oldCarPosition;
1088-
10891086
if (attachedCar == null || attachedCar.Train != Viewer.SelectedTrain || carPosition != oldCarPosition)
10901087
{
10911088
if (Front)

Source/RunActivity/Viewer3D/Popups/TrainCarOperationsViewerWindow.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,9 +512,9 @@ public override void PrepareFrame(ElapsedTime elapsedTime, bool updateFull)
512512
}
513513
// Updates power supply status
514514
else if (isElectricDieselLocomotive &&
515-
(PowerSupplyStatus != null && PowerSupplyStatus != Owner.Viewer.PlayerTrain.Cars[CarPosition].GetStatus()
515+
(PowerSupplyStatus != null && PowerSupplyStatus != Owner.Viewer.PlayerTrain.Cars[CarPosition].GetStatus()
516516
|| (BatteryStatus != null && BatteryStatus != Owner.Viewer.PlayerTrain.Cars[CarPosition].GetStatus())
517-
|| (CircuitBreakerState != null && CircuitBreakerState != (trainCar as MSTSElectricLocomotive).ElectricPowerSupply.CircuitBreaker.State.ToString())))
517+
|| (CircuitBreakerState != null && (trainCar is MSTSElectricLocomotive) && CircuitBreakerState != (trainCar as MSTSElectricLocomotive).ElectricPowerSupply.CircuitBreaker.State.ToString())))
518518
{
519519
Layout();
520520
UpdateWindowSize();

0 commit comments

Comments
 (0)