diff --git a/GestureLock/HarmonyPatches.cs b/GestureLock/HarmonyPatches.cs index 2c5fd24..cb59a01 100644 --- a/GestureLock/HarmonyPatches.cs +++ b/GestureLock/HarmonyPatches.cs @@ -11,7 +11,7 @@ internal class CVRInputModule_XRPatches { // Get input from SteamVR because new input system is nerfed for OpenXR... private static readonly SteamVR_Action_Boolean _gestureToggleButton = SteamVR_Input.GetAction("ControllerToggleGestures", false); - + private static bool _isLocked; private static float _oldGestureLeft; private static float _oldGestureRight; @@ -20,7 +20,7 @@ internal class CVRInputModule_XRPatches [HarmonyPatch(typeof(CVRInputModule_XR), nameof(CVRInputModule_XR.Update_Emotes))] private static void Postfix_CVRInputModule_XR_Update_Emotes(ref CVRInputModule_XR __instance) { - if (!MetaPort.Instance.isUsingVr) + if (!MetaPort.Instance.isUsingVr) return; bool leftInput = _gestureToggleButton.GetLastStateDown(SteamVR_Input_Sources.LeftHand); @@ -31,7 +31,7 @@ internal class CVRInputModule_XRPatches if (rightInput && __instance._rightModule.Type == EXRControllerType.Index || __instance._inputManager.oneHanded) return; - + if (leftInput || rightInput) { _isLocked = !_isLocked; @@ -42,7 +42,7 @@ internal class CVRInputModule_XRPatches if (!_isLocked) return; - + __instance._inputManager.gestureLeft = _oldGestureLeft; __instance._inputManager.gestureRight = _oldGestureRight; }