From 669ce9f88c15b85dae4d29815e8ce00c18ea74aa Mon Sep 17 00:00:00 2001 From: Soar Qin Date: Wed, 11 Mar 2026 19:26:40 +0800 Subject: [PATCH] minor fixes --- CheatEnabler/Patches/DysonSpherePatch.cs | 5 +++-- UXAssist/Patches/FactoryPatch.cs | 5 +++-- UXAssist/Patches/LogisticsPatch.cs | 7 +++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CheatEnabler/Patches/DysonSpherePatch.cs b/CheatEnabler/Patches/DysonSpherePatch.cs index b7c8ab1..c35e7c2 100644 --- a/CheatEnabler/Patches/DysonSpherePatch.cs +++ b/CheatEnabler/Patches/DysonSpherePatch.cs @@ -394,8 +394,9 @@ public class DysonSpherePatch : PatchImpl } swarm.RemoveSolarSail(index); }), - // return false; - new CodeInstruction(OpCodes.Ldc_I4_0), + // return true; + // to avoid conflict with QuickAbsorbPatch + new CodeInstruction(OpCodes.Ldc_I4_1), new CodeInstruction(OpCodes.Ret) ); return matcher.InstructionEnumeration(); diff --git a/UXAssist/Patches/FactoryPatch.cs b/UXAssist/Patches/FactoryPatch.cs index 398342e..101df2e 100644 --- a/UXAssist/Patches/FactoryPatch.cs +++ b/UXAssist/Patches/FactoryPatch.cs @@ -2441,8 +2441,9 @@ public class FactoryPatch : PatchImpl { return; } - if (GameMain.instance.timei < nextTimei) return; - nextTimei = GameMain.instance.timei + 12; + var main = GameMain.instance; + if (main.timei < nextTimei) return; + nextTimei = main.timei + 12; ref var entityData = ref factory.entityPool[entityId]; if (entityData.beltId <= 0) return; diff --git a/UXAssist/Patches/LogisticsPatch.cs b/UXAssist/Patches/LogisticsPatch.cs index 54940b1..f5bea7f 100644 --- a/UXAssist/Patches/LogisticsPatch.cs +++ b/UXAssist/Patches/LogisticsPatch.cs @@ -311,14 +311,17 @@ public static class LogisticsPatch { if (!Input.GetKey(code)) return false; + var main = GameMain.instance; + if (main == null) + return false; if (code != _lastKey) { _lastKey = code; - _nextKeyTick = GameMain.instance.timei + 30; + _nextKeyTick = main.timei + 30; return true; } - var currTick = GameMain.instance.timei; + var currTick = main.timei; if (_nextKeyTick > currTick) return false; _nextKeyTick = currTick + 4; return true;