From cb4a3d49beb6e40e114cafa8112e60f7d3ca2cc5 Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Tue, 8 Nov 2022 15:15:45 +0000 Subject: [PATCH] fix inputs sticking (TEST) --- QSB/Inputs/Patches/InputPatches.cs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/QSB/Inputs/Patches/InputPatches.cs b/QSB/Inputs/Patches/InputPatches.cs index c482ace7..7196a62b 100644 --- a/QSB/Inputs/Patches/InputPatches.cs +++ b/QSB/Inputs/Patches/InputPatches.cs @@ -9,7 +9,18 @@ internal class InputPatches : QSBPatch public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect; [HarmonyPrefix] - [HarmonyPatch(typeof(OWInput), nameof(OWInput.Update))] - public static bool OWInput_Update() - => QSBInputManager.Instance.InputsEnabled; + [HarmonyPatch(typeof(AbstractCommands), nameof(AbstractCommands.Update))] + public static bool AbstractCommands_Update(AbstractCommands __instance) + { + __instance.Consumed = false; + __instance.WasActiveLastFrame = __instance.IsActiveThisFrame; + __instance.IsActiveThisFrame = false; + + if (__instance.WasActiveLastFrame) + { + __instance.InputStartedTime = float.MaxValue; + } + + return false; + } } \ No newline at end of file