diff --git a/QSB/MeteorSync/Patches/MeteorServerPatches.cs b/QSB/MeteorSync/Patches/MeteorServerPatches.cs index a090418a..ae29fb99 100644 --- a/QSB/MeteorSync/Patches/MeteorServerPatches.cs +++ b/QSB/MeteorSync/Patches/MeteorServerPatches.cs @@ -157,6 +157,22 @@ namespace QSB.MeteorSync.Patches } + [HarmonyPrefix] + [HarmonyPatch(typeof(DetachableFragment), nameof(DetachableFragment.Detach))] + public static void Detach_Prefix(DetachableFragment __instance, out FragmentIntegrity __state) + { + // this gets set to null in Detach, so store it here and and then restore it in postfix + __state = __instance._fragmentIntegrity; + } + + [HarmonyPostfix] + [HarmonyPatch(typeof(DetachableFragment), nameof(DetachableFragment.Detach))] + public static void Detach_Postfix(DetachableFragment __instance, FragmentIntegrity __state) + { + __instance._fragmentIntegrity = __state; + } + + [HarmonyPrefix] [HarmonyPatch(typeof(DebrisLeash), nameof(DebrisLeash.MoveByDistance))] public static bool MoveByDistance(DebrisLeash __instance,