mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
[IKSimulatedRootAngleFix] Fixed reset method so torso faces forward properly
This commit is contained in:
parent
8c2943ae99
commit
2ad8a2c0f7
1 changed files with 12 additions and 0 deletions
|
@ -21,6 +21,13 @@ public class IKSimulatedRootAngleFixMod : MelonMod
|
|||
BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
|
||||
HarmonyInstance.Patch( // fix offsetting of _ikSimulatedRootAngle when player rotates on wall or ceiling
|
||||
typeof(IKHandler).GetMethod(nameof(IKHandler.Reset),
|
||||
BindingFlags.Public | BindingFlags.Instance),
|
||||
postfix: new HarmonyMethod(typeof(IKSimulatedRootAngleFixMod).GetMethod(nameof(OnHandlerReset),
|
||||
BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
|
||||
HarmonyInstance.Patch( // why did i dupe logic weirdly between Desktop & VR IKHandler ...
|
||||
typeof(IKHandlerDesktop).GetMethod(nameof(IKHandlerDesktop.HandleBodyHeading),
|
||||
BindingFlags.NonPublic | BindingFlags.Instance),
|
||||
|
@ -68,6 +75,11 @@ public class IKSimulatedRootAngleFixMod : MelonMod
|
|||
return false;
|
||||
}
|
||||
|
||||
private static void OnHandlerReset(ref IKHandler __instance)
|
||||
{
|
||||
__instance._ikSimulatedRootAngle = GetRemappedPlayerHeading();
|
||||
}
|
||||
|
||||
private static bool OnHandleBodyHeading(ref IKHandlerDesktop __instance)
|
||||
{
|
||||
if (IKSystem.Instance.BodyHeadingLimit <= 0f)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue