BepisPlugins
BepisPlugins copied to clipboard
KK - Extended Save Format exception on 2023(latest) Steam Version KK+AfterParty
Describe the bug Game: KK(https://steamdb.info/app/1073440/) With the After Party DLC Updated in 2023/2/18 (previous tested works in 2022/12)
To Reproduce Steps to reproduce the behavior:
- Download BepisPlugins and extract all to game directory
- Run the game and check BepInEx's LogOutput.log
- Found exception in log:
[Message: BepInEx] BepInEx 5.4.21.0 - Koikatsu Party (6/5/2019 11:00:00 PM)
....
....
[Info : BepInEx] Loading [Extended Save 19.1]
[Error : HarmonyX] Failed to patch static bool SaveData::<Load>m__4(SaveData+Heroine item): System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
at System.Collections.Generic.List`1[HarmonyLib.CodeInstruction].CheckIndex (Int32 index) [0x00000] in <filename unknown>:0
at System.Collections.Generic.List`1[HarmonyLib.CodeInstruction].InsertRange (Int32 index, IEnumerable`1 collection) [0x00000] in <filename unknown>:0
at HarmonyLib.CodeMatcher.Insert (HarmonyLib.CodeInstruction[] instructions) [0x00000] in <filename unknown>:0
at HarmonyLib.CodeMatcher.InsertAndAdvance (HarmonyLib.CodeInstruction[] instructions) [0x00000] in <filename unknown>:0
at ExtensibleSaveFormat.ExtendedSave+Hooks.SaveDataLoadTranspiler (IEnumerable`1 instructions) [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
at HarmonyLib.Internal.Patching.ILManipulator.ApplyTranspilers (System.Reflection.Emit.ILGenerator il, System.Reflection.MethodBase original, System.Func`2 getLocal, System.Func`1 defineLabel) [0x00000] in <filename unknown>:0
at HarmonyLib.Internal.Patching.ILManipulator.WriteTo (Mono.Cecil.Cil.MethodBody body, System.Reflection.MethodBase original) [0x00000] in <filename unknown>:0
at HarmonyLib.Public.Patching.HarmonyManipulator.WriteTranspilers () [0x00000] in <filename unknown>:0
at HarmonyLib.Public.Patching.HarmonyManipulator.WriteImpl () [0x00000] in <filename unknown>:0
Expected behavior There should be no exception at all.
I guess the game update break current patch for function static bool SaveData::<Load>m__4(SaveData+Heroine item)
It's strongly suggested to not update the game on steam (there are other non-critical issues as well). You can downgrade it with KK HF Patch. I'll keep the issue open in case someone does want to fix it while maintaining backwards compatibility.