1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-09 02:13:29 +08:00

various fixes

This commit is contained in:
2023-10-15 23:24:57 +08:00
parent d85afccb0d
commit d9ac5e5786
3 changed files with 13 additions and 1 deletions

View File

@@ -312,6 +312,7 @@ public static class FactoryPatch
return;
}
_beltSignalPatch?.UnpatchSelf();
_beltSignalPatch = null;
_initialized = false;
_signalBelts = null;
_signalBeltsCapacity = 0;

View File

@@ -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;
}
}

View File

@@ -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)