fix inputs sticking (TEST)

This commit is contained in:
Mister_Nebula 2022-11-08 15:15:45 +00:00
parent 165ae8fdaf
commit cb4a3d49be

View File

@ -9,7 +9,18 @@ internal class InputPatches : QSBPatch
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect; public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(OWInput), nameof(OWInput.Update))] [HarmonyPatch(typeof(AbstractCommands), nameof(AbstractCommands.Update))]
public static bool OWInput_Update() public static bool AbstractCommands_Update(AbstractCommands __instance)
=> QSBInputManager.Instance.InputsEnabled; {
__instance.Consumed = false;
__instance.WasActiveLastFrame = __instance.IsActiveThisFrame;
__instance.IsActiveThisFrame = false;
if (__instance.WasActiveLastFrame)
{
__instance.InputStartedTime = float.MaxValue;
}
return false;
}
} }