tanukinomori / DSPMod

3 stars 5 forks source link

[TankManualInOutAmountMultiply] Failed to patch virtual void UITankWindow::_OnUpdate() #10

Closed starfi5h closed 3 years ago

starfi5h commented 3 years ago

img Game version 0.8.19.7863

[Error : HarmonyX] Failed to patch virtual void UITankWindow::_OnUpdate(): System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection. at System.ThrowHelper.ThrowArgumentException (System.ExceptionResource resource) [0x0000b] in <2fa7a6a452ca43df998f07fd1486c0df>:IL_000B at System.Collections.Generic.List1[T].RemoveRange (System.Int32 index, System.Int32 count) [0x00023] in <2fa7a6a452ca43df998f07fd1486c0df>:IL_0023 at HarmonyLib.CodeMatcher.RemoveInstructions (System.Int32 count) [0x0000c] in <116dd996dda44480a48a0fc9ee2308ed>:IL_000C at TankManualInOutAmountMultiply.Patch_UITankWindow_OnUpdate.Transpiler (System.Collections.Generic.IEnumerable1[T] instructions) [0x0010e] in :IL_010E at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <2fa7a6a452ca43df998f07fd1486c0df>:IL_0032 --- End of inner exception stack trace --- at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0004b] in <2fa7a6a452ca43df998f07fd1486c0df>:IL_004B at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <2fa7a6a452ca43df998f07fd1486c0df>:IL_0000 at HarmonyLib.Internal.Patching.ILManipulator.ApplyTranspilers (System.Reflection.Emit.ILGenerator il, System.Reflection.MethodBase original, System.Func2[T,TResult] getLocal, System.Func1[TResult] defineLabel) [0x00093] in <116dd996dda44480a48a0fc9ee2308ed>:IL_0093 at HarmonyLib.Internal.Patching.ILManipulator.WriteTo (Mono.Cecil.Cil.MethodBody body, System.Reflection.MethodBase original) [0x00066] in <116dd996dda44480a48a0fc9ee2308ed>:IL_0066 at HarmonyLib.Public.Patching.HarmonyManipulator.WriteTranspiledMethod (MonoMod.Cil.ILContext ctx, System.Reflection.MethodBase original, System.Collections.Generic.List1[T] transpilers, System.Boolean debug) [0x00073] in <116dd996dda44480a48a0fc9ee2308ed>:IL_0073 at HarmonyLib.Public.Patching.HarmonyManipulator.MakePatched (System.Reflection.MethodBase original, MonoMod.Cil.ILContext ctx, System.Collections.Generic.List1[T] prefixes, System.Collections.Generic.List1[T] postfixes, System.Collections.Generic.List1[T] transpilers, System.Collections.Generic.List1[T] finalizers, System.Collections.Generic.List1[T] ilmanipulators, System.Boolean debug) [0x0003b] in <116dd996dda44480a48a0fc9ee2308ed>:IL_003B [Error : Unity Log] InvalidProgramException: Invalid IL code in DMD<_OnUpdate>?-1274290432:_UITankWindow::_OnUpdate (UITankWindow): method body is empty.

Stack trace: System.RuntimeMethodHandle.GetFunctionPointer () (at <2fa7a6a452ca43df998f07fd1486c0df>:IL_0000) MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform.GetFunctionPointer (System.Reflection.MethodBase method, System.RuntimeMethodHandle handle) (at <33dff776d87748ecb372a90c5ddfc734>:IL_0000) MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform.GetNativeStart (System.Reflection.MethodBase method) (at <33dff776d87748ecb372a90c5ddfc734>:IL_0044) MonoMod.RuntimeDetour.DetourHelper.GetNativeStart (System.Reflection.MethodBase method) (at <33dff776d87748ecb372a90c5ddfc734>:IL_0005) MonoMod.RuntimeDetour.Detour._TopApply () (at <33dff776d87748ecb372a90c5ddfc734>:IL_0025) MonoMod.RuntimeDetour.Detour._RefreshChain (System.Reflection.MethodBase method) (at <33dff776d87748ecb372a90c5ddfc734>:IL_0149) MonoMod.RuntimeDetour.Detour.Apply () (at <33dff776d87748ecb372a90c5ddfc734>:IL_0053) MonoMod.RuntimeDetour.Detour..ctor (System.Reflection.MethodBase from, System.Reflection.MethodBase to, MonoMod.RuntimeDetour.DetourConfig& config) (at <33dff776d87748ecb372a90c5ddfc734>:IL_02D9) DMD?-1274290432._MonoMod_RuntimeDetour_ILHook+Context::Refresh (MonoMod.RuntimeDetour.ILHook+Context this) (at <0577402ba53845db9135b6612945e7ef>:IL_0128) DMD<>?-1274290432.Trampoline<MonoMod.RuntimeDetour.ILHook+Context::Refresh>?884824064 (System.Object ) (at <443abd45effa4740bd12388229ce5bd6>:IL_0020) HarmonyLib.Internal.RuntimeFixes.StackTraceFixes.OnILChainRefresh (System.Object self) (at <116dd996dda44480a48a0fc9ee2308ed>:IL_0000) MonoMod.RuntimeDetour.ILHook.Apply () (at <33dff776d87748ecb372a90c5ddfc734>:IL_0059) HarmonyLib.Public.Patching.ManagedMethodPatcher.DetourTo (System.Reflection.MethodBase replacement) (at <116dd996dda44480a48a0fc9ee2308ed>:IL_0047) Rethrow as HarmonyException: IL Compile Error (unknown location) HarmonyLib.Public.Patching.ManagedMethodPatcher.DetourTo (System.Reflection.MethodBase replacement) (at <116dd996dda44480a48a0fc9ee2308ed>:IL_005F) HarmonyLib.PatchFunctions.UpdateWrapper (System.Reflection.MethodBase original, HarmonyLib.PatchInfo patchInfo) (at <116dd996dda44480a48a0fc9ee2308ed>:IL_0033) Rethrow as HarmonyException: IL Compile Error (unknown location) HarmonyLib.PatchClassProcessor.ReportException (System.Exception exception, System.Reflection.MethodBase original) (at <116dd996dda44480a48a0fc9ee2308ed>:IL_0045) HarmonyLib.PatchClassProcessor.Patch () (at <116dd996dda44480a48a0fc9ee2308ed>:IL_0084) HarmonyLib.Harmony.PatchAll (System.Type type) (at <116dd996dda44480a48a0fc9ee2308ed>:IL_0008) TankManualInOutAmountMultiply.TankManualInOutAmountMultiply.Awake () (at :IL_005D) UnityEngine.GameObject:AddComponent(Type) BepInEx.Bootstrap.Chainloader:Start() UnityEngine.Application:.cctor()

starfi5h commented 3 years ago

The issue is now fixed with TankManualInOutAmountMultiply version 0.0.2 (085e693). Thank you.