[JumpPatch] Fix PRM conflict

This commit is contained in:
NotAKidoS 2023-05-02 12:57:28 -05:00
parent e512c9dd70
commit 6fd838e88b
3 changed files with 19 additions and 11 deletions

View file

@ -7,9 +7,17 @@ namespace NAK.JumpPatch.HarmonyPatches;
class MovementSystemPatches
{
[HarmonyPrefix]
[HarmonyPatch(typeof(MovementSystem), "Update")]
private static void Prefix_MovementSystem_Update(ref bool ____isGrounded)
[HarmonyPatch(typeof(MovementSystem), nameof(MovementSystem.Update))]
private static void Prefix_MovementSystem_Update(ref bool ____isGrounded, ref bool __state)
{
__state = CVRInputManager.Instance.jump;
CVRInputManager.Instance.jump = CVRInputManager.Instance.jump && ____isGrounded;
}
[HarmonyPostfix]
[HarmonyPatch(typeof(MovementSystem), nameof(MovementSystem.Update))]
private static void Postfix_MovementSystem_Update(ref bool __state)
{
CVRInputManager.Instance.jump = __state;
}
}