From 1631effeff77c29147c9652937b4015ccc141011 Mon Sep 17 00:00:00 2001 From: NotAKidoS <37721153+NotAKidOnSteam@users.noreply.github.com> Date: Sun, 24 Sep 2023 06:14:11 -0500 Subject: [PATCH] [IKFixes] Fix Seated Play button not returning when trackers disconnect. --- IKFixes/HarmonyPatches.cs | 20 +++++++++----------- IKFixes/Properties/AssemblyInfo.cs | 2 +- IKFixes/format.json | 4 ++-- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/IKFixes/HarmonyPatches.cs b/IKFixes/HarmonyPatches.cs index f65c2a5..12078c9 100644 --- a/IKFixes/HarmonyPatches.cs +++ b/IKFixes/HarmonyPatches.cs @@ -173,13 +173,6 @@ internal static class BodySystemPatches int count = IKSystem.Instance.AllTrackingPoints.FindAll(m => m.isActive && m.isValid && m.suggestedRole > TrackingPoint.TrackingRole.Invalid).Count; - // fixes having all tracking points disabled forcing calibration - if (count == 0) - { - __instance._fbtAvailable = false; - return false; - } - // solid body count block int num = 0; if (BodySystem.enableLeftFootTracking) num++; @@ -190,10 +183,15 @@ internal static class BodySystemPatches if (BodySystem.enableChestTracking) num++; if (BodySystem.enableLeftElbowTracking) num++; if (BodySystem.enableRightElbowTracking) num++; - - __instance._fbtAvailable = (count >= num); - CVR_MenuManager.Instance.coreData.core.fullBodyActive = __instance._fbtAvailable = (count >= num && num != 0); - + + // fixes having all tracking points disabled forcing calibration + if (num == 0 || count == 0) + { + CVR_MenuManager.Instance.coreData.core.fullBodyActive = __instance._fbtAvailable = false; + return false; + } + + CVR_MenuManager.Instance.coreData.core.fullBodyActive = __instance._fbtAvailable = (count >= num); return false; } diff --git a/IKFixes/Properties/AssemblyInfo.cs b/IKFixes/Properties/AssemblyInfo.cs index 6d8d270..8b3a92f 100644 --- a/IKFixes/Properties/AssemblyInfo.cs +++ b/IKFixes/Properties/AssemblyInfo.cs @@ -25,6 +25,6 @@ using System.Reflection; namespace NAK.IKFixes.Properties; internal static class AssemblyInfoParams { - public const string Version = "1.0.8"; + public const string Version = "1.0.9"; public const string Author = "NotAKidoS"; } \ No newline at end of file diff --git a/IKFixes/format.json b/IKFixes/format.json index 65db988..186f8e8 100644 --- a/IKFixes/format.json +++ b/IKFixes/format.json @@ -1,7 +1,7 @@ { "_id": 142, "name": "IKFixes", - "modversion": "1.0.8", + "modversion": "1.0.9", "gameversion": "2023r172", "loaderversion": "0.6.1", "modtype": "Mod", @@ -19,6 +19,6 @@ ], "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r21/IKFixes.dll", "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/IKFixes/", - "changelog": "- Updates for 2023r172\n- Removed unneeded settings (IKPose & NetIKPass).\n- Fixed halfbody fake root angle option.\n- Added Reset Settings UIExpansionKit button.\n- Fixed issue with MelonPref identifiers containing illegal characters.\n- Movement Parent IK handling now respects new orientation mode.", + "changelog": "- Fix Seated Play button not returning once disconnecting all trackers from SteamVR.", "embedcolor": "f46e49" } \ No newline at end of file