From dad8c884a0b11b0647b729ea7922790b919da1ef Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Tue, 13 Apr 2021 17:40:11 +0100 Subject: [PATCH] fix hatch close noise playing when walking under ship --- QSB/ShipSync/Patches/ShipPatches.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/QSB/ShipSync/Patches/ShipPatches.cs b/QSB/ShipSync/Patches/ShipPatches.cs index 6e822bd0..dbbcdfa6 100644 --- a/QSB/ShipSync/Patches/ShipPatches.cs +++ b/QSB/ShipSync/Patches/ShipPatches.cs @@ -45,10 +45,10 @@ namespace QSB.ShipSync.Patches public static bool ShipTractorBeamSwitch_OnTriggerExit(Collider hitCollider, bool ____isPlayerInShip, bool ____functional) { - if (!____isPlayerInShip && ____functional && hitCollider.CompareTag("PlayerDetector")) + var shipTransform = Locator.GetShipTransform(); + var hatchController = shipTransform.GetComponentInChildren(); + if (!____isPlayerInShip && ____functional && hitCollider.CompareTag("PlayerDetector") && !hatchController.GetValue("_hatchObject").activeSelf) { - var shipTransform = Locator.GetShipTransform(); - var hatchController = shipTransform.GetComponentInChildren(); hatchController.Invoke("CloseHatch"); QSBEventManager.FireEvent(EventNames.QSBHatchState, false); }