From a188e58c7b0c42889e429f45c171e0eeffe1afbf Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 28 Aug 2023 00:07:14 -0400 Subject: [PATCH] BH related patches folder + fix TOQK proxy appearing --- .../MeteorControllerPatches.cs | 0 .../TimedFragmentIntegrityPatches.cs | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+) rename NewHorizons/Patches/{ => BrittleHollowPatches}/MeteorControllerPatches.cs (100%) create mode 100644 NewHorizons/Patches/BrittleHollowPatches/TimedFragmentIntegrityPatches.cs diff --git a/NewHorizons/Patches/MeteorControllerPatches.cs b/NewHorizons/Patches/BrittleHollowPatches/MeteorControllerPatches.cs similarity index 100% rename from NewHorizons/Patches/MeteorControllerPatches.cs rename to NewHorizons/Patches/BrittleHollowPatches/MeteorControllerPatches.cs diff --git a/NewHorizons/Patches/BrittleHollowPatches/TimedFragmentIntegrityPatches.cs b/NewHorizons/Patches/BrittleHollowPatches/TimedFragmentIntegrityPatches.cs new file mode 100644 index 00000000..6ce54f7b --- /dev/null +++ b/NewHorizons/Patches/BrittleHollowPatches/TimedFragmentIntegrityPatches.cs @@ -0,0 +1,19 @@ +using HarmonyLib; + +namespace NewHorizons.Patches.BrittleHollowPatches; + +[HarmonyPatch(typeof(TimedFragmentIntegrity))] +internal class TimedFragmentIntegrityPatches +{ + // For some inexplicable reason Mobius decided to implement some weird custom loop using delayed method invoking + // This starts on Awake and isn't stopped by the object being set inactive + // Mobius why + // We just need to have this method not run if the object is inactive, to prevent the fragment being detached and activating its own proxy body + // While the fragment itself never appears, the proxy does + [HarmonyPrefix] + [HarmonyPatch(nameof(TimedFragmentIntegrity.OnLatestTimeReached))] + public static bool TimedFragmentIntegrity_OnLatestTimeReached(TimedFragmentIntegrity __instance) + { + return __instance.gameObject.activeInHierarchy; + } +}