Skip to content

Commit c6ec303

Browse files
committed
Fix a bug triggered by changing scenes and then later exiting map mode
1 parent 504aa6e commit c6ec303

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ProbeControlRoom/ProbeControlRoom.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,10 @@ private void toggleIVA()
240240
/// </summary>
241241
public void OnDestroy()
242242
{
243-
stopIVA();
243+
if (isActive)
244+
{
245+
stopIVA();
246+
}
244247

245248
ProbeControlRoomUtils.Logger.debug("OnDestroy()");
246249

@@ -555,7 +558,7 @@ public void stopIVA()
555558
InputLockManager.RemoveControlLock("ProbeControlRoom");
556559

557560
//Switch back to normal cameras
558-
if (CameraManager.Instance.currentCameraMode == CameraManager.CameraMode.IVA)
561+
if (CameraManager.Instance != null && CameraManager.Instance.currentCameraMode == CameraManager.CameraMode.IVA)
559562
{
560563
CameraManager.Instance.SetCameraFlight();
561564
}

0 commit comments

Comments
 (0)