From 22a44bc266d8b8f2708c73746af0050dfd6c7594 Mon Sep 17 00:00:00 2001 From: Soar Qin Date: Sat, 25 Nov 2023 03:15:11 +0800 Subject: [PATCH] minor fix --- UXAssist/FactoryPatch.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/UXAssist/FactoryPatch.cs b/UXAssist/FactoryPatch.cs index 089fc1e..113f478 100644 --- a/UXAssist/FactoryPatch.cs +++ b/UXAssist/FactoryPatch.cs @@ -89,6 +89,17 @@ public static class FactoryPatch return matcher.InstructionEnumeration(); } + [HarmonyTranspiler, HarmonyPatch(typeof(BuildTool_Reform), MethodType.Constructor)] + private static IEnumerable BuildTool_Reform_Constructor_Transpiler(IEnumerable instructions, ILGenerator generator) + { + var matcher = new CodeMatcher(instructions, generator); + matcher.MatchForward(false, + new CodeMatch(ci => ci.opcode == OpCodes.Ldc_I4_S && ci.OperandIs(100)) + ); + matcher.Repeat(m => m.SetAndAdvance(OpCodes.Ldc_I4, 900)); + return matcher.InstructionEnumeration(); + } + public static class NightLight { private static Harmony _patch; @@ -495,17 +506,6 @@ public static class FactoryPatch _patch = null; } - [HarmonyTranspiler, HarmonyPatch(typeof(BuildTool_Reform), MethodType.Constructor)] - private static IEnumerable BuildTool_Reform_Constructor_Transpiler(IEnumerable instructions, ILGenerator generator) - { - var matcher = new CodeMatcher(instructions, generator); - matcher.MatchForward(false, - new CodeMatch(ci => ci.opcode == OpCodes.Ldc_I4_S && ci.OperandIs(100)) - ); - matcher.Repeat(m => m.SetAndAdvance(OpCodes.Ldc_I4, 900)); - return matcher.InstructionEnumeration(); - } - [HarmonyTranspiler, HarmonyPatch(typeof(BuildTool_Reform), nameof(BuildTool_Reform.ReformAction))] private static IEnumerable BuildTool_Reform_ReformAction_Transpiler(IEnumerable instructions, ILGenerator generator) {