mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-29 00:32:43 +00:00
hack to get DetachableFragment._fragmentIntegrity to not be null after Detach
This commit is contained in:
parent
dcf8bf0510
commit
d3735a5b60
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user