Skip to content

Commit 8ae6bb7

Browse files
committed
Fix the issue with the behaviour of Camera 2 after closing F9.
1 parent abe7c8a commit 8ae6bb7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Source/RunActivity/Viewer3D/Cameras.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,10 +1089,14 @@ protected override void OnActivate(bool sameCamera)
10891089
oldCarPosition = oldCarPosition == 0 && carPosition == 0 ? -1 : oldCarPosition;
10901090
}
10911091

1092-
if (attachedCar != null && !isVisibleTrainCarViewerOrWebpage && !Front)
1093-
{// Reset behaviour of camera 3, after closing F9-window and F9-web.
1092+
if (attachedCar != null && !isVisibleTrainCarViewerOrWebpage)
1093+
{ // Reset behaviour of camera 2 and camera 3, after closing F9-window and F9-web.
10941094
var attachedCarPosition = attachedCar.Train.Cars.TakeWhile(x => x.CarID != attachedCar.CarID).Count();
1095-
if (attachedCarPosition == carPosition)
1095+
if (Front && attachedCarPosition == carPosition)
1096+
{
1097+
attachedCar = trainCars.First();
1098+
}
1099+
if (!Front && attachedCarPosition == carPosition)
10961100
{
10971101
attachedCar = trainCars.Last();
10981102
}

0 commit comments

Comments
 (0)