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); }