Skip to content

Commit abe7c8a

Browse files
committed
Fix the issue with the behaviour of Camera 3 after closing F9.
1 parent fb8a24d commit abe7c8a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Source/RunActivity/Viewer3D/Cameras.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,21 @@ 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+
if (isVisibleTrainCarViewerOrWebpage)
1087+
{
1088+
// Update the camera view
1089+
oldCarPosition = oldCarPosition == 0 && carPosition == 0 ? -1 : oldCarPosition;
1090+
}
1091+
1092+
if (attachedCar != null && !isVisibleTrainCarViewerOrWebpage && !Front)
1093+
{// Reset behaviour of camera 3, after closing F9-window and F9-web.
1094+
var attachedCarPosition = attachedCar.Train.Cars.TakeWhile(x => x.CarID != attachedCar.CarID).Count();
1095+
if (attachedCarPosition == carPosition)
1096+
{
1097+
attachedCar = trainCars.Last();
1098+
}
1099+
}
1100+
10861101
if (attachedCar == null || attachedCar.Train != Viewer.SelectedTrain || carPosition != oldCarPosition)
10871102
{
10881103
if (Front)

0 commit comments

Comments
 (0)