diff --git a/CheatEnabler/FactoryPatch.cs b/CheatEnabler/FactoryPatch.cs index e6caa00..654cef6 100644 --- a/CheatEnabler/FactoryPatch.cs +++ b/CheatEnabler/FactoryPatch.cs @@ -312,6 +312,7 @@ public static class FactoryPatch return; } _beltSignalPatch?.UnpatchSelf(); + _beltSignalPatch = null; _initialized = false; _signalBelts = null; _signalBeltsCapacity = 0; diff --git a/CompressSave/CompressSave.cs b/CompressSave/CompressSave.cs index bf622ed..410dee6 100644 --- a/CompressSave/CompressSave.cs +++ b/CompressSave/CompressSave.cs @@ -91,13 +91,16 @@ public class CompressSave : BaseUnityPlugin { PatchUISaveGame.OnDestroy(); _patchUISave.UnpatchSelf(); + _patchUISave = null; } if (_patchUILoad != null) { PatchUILoadGame.OnDestroy(); _patchUILoad.UnpatchSelf(); + _patchUILoad = null; } _patchSave?.UnpatchSelf(); + _patchSave = null; } } diff --git a/UXAssist/DysonSpherePatch.cs b/UXAssist/DysonSpherePatch.cs index d3aa0fa..15beb82 100644 --- a/UXAssist/DysonSpherePatch.cs +++ b/UXAssist/DysonSpherePatch.cs @@ -100,9 +100,9 @@ public static class DysonSpherePatch } else { - _initialized = false; _patch?.UnpatchSelf(); _patch = null; + _initialized = false; _nodeForAbsorb = null; } } @@ -179,6 +179,14 @@ public static class DysonSpherePatch InitNodeForAbsorb(); } + [HarmonyPostfix] + [HarmonyPatch(typeof(GameMain), nameof(GameMain.End))] + private static void GameMain_End_Postfix() + { + _initialized = false; + _nodeForAbsorb = null; + } + [HarmonyPostfix] [HarmonyPatch(typeof(DysonNode), nameof(DysonNode.RecalcCpReq))] private static void DysonNode_RecalcCpReq_Postfix(DysonNode __instance)