From e49dd307f5b0619f61649e9935009de0770e5b2b Mon Sep 17 00:00:00 2001 From: _nebula <41904486+misternebula@users.noreply.github.com> Date: Mon, 23 Jan 2023 20:13:55 +0000 Subject: [PATCH] fix interference --- QSB/Tools/ProbeTool/QSBProbeCamera.cs | 19 ++++++++----------- QSB/Tools/ProbeTool/QSBSurveyorProbe.cs | 2 ++ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/QSB/Tools/ProbeTool/QSBProbeCamera.cs b/QSB/Tools/ProbeTool/QSBProbeCamera.cs index 8efaa166..f723f963 100644 --- a/QSB/Tools/ProbeTool/QSBProbeCamera.cs +++ b/QSB/Tools/ProbeTool/QSBProbeCamera.cs @@ -1,4 +1,5 @@ -using UnityEngine; +using QSB.Player; +using UnityEngine; namespace QSB.Tools.ProbeTool; @@ -15,8 +16,8 @@ public class QSBProbeCamera : MonoBehaviour private Quaternion _origLocalRotation; private Quaternion _origParentLocalRotation; private Vector2 _cameraRotation = Vector2.zero; - private QuantumMoon _quantumMoon; private SandLevelController _sandLevelController; + private PlayerInfo owner; public event ProbeCamera.RotateCameraEvent OnRotateCamera; @@ -33,11 +34,8 @@ public class QSBProbeCamera : MonoBehaviour private void Start() { - var astroObject = Locator.GetAstroObject(AstroObject.Name.QuantumMoon); - if (astroObject != null) - { - _quantumMoon = astroObject.GetComponent(); - } + var probe = GetComponentInParent(); + owner = probe.GetOwner(); } public static OWCamera GetLastSnapshotCamera() => @@ -53,10 +51,9 @@ public class QSBProbeCamera : MonoBehaviour => _sandLevelController = sandLevelController; public bool HasInterference() => - _id != ProbeCamera.ID.PreLaunch - //&& ((this._quantumMoon != null && this._quantumMoon.IsPlayerInside() != this._quantumMoon.IsProbeInside()) - || (_sandLevelController != null && _sandLevelController.IsPointBuried(transform.position)); - //|| (Locator.GetCloakFieldController() != null && Locator.GetCloakFieldController().isPlayerInsideCloak != Locator.GetCloakFieldController().isProbeInsideCloak)); + (_id != ProbeCamera.ID.PreLaunch && owner.IsInMoon != owner.Probe.InsideQuantumMoon) + || (_sandLevelController != null && _sandLevelController.IsPointBuried(transform.position)) + || (Locator.GetCloakFieldController() != null && owner.IsInCloak != owner.Probe.InsideCloak); public RenderTexture TakeSnapshot() { diff --git a/QSB/Tools/ProbeTool/QSBSurveyorProbe.cs b/QSB/Tools/ProbeTool/QSBSurveyorProbe.cs index d779aa6a..b469fcb0 100644 --- a/QSB/Tools/ProbeTool/QSBSurveyorProbe.cs +++ b/QSB/Tools/ProbeTool/QSBSurveyorProbe.cs @@ -116,6 +116,8 @@ public class QSBSurveyorProbe : MonoBehaviour, ILightSource _owner = player; } + public PlayerInfo GetOwner() => _owner; + private void OnWarpComplete() => Deactivate(); public bool IsRetrieving()