BepisPlugins icon indicating copy to clipboard operation
BepisPlugins copied to clipboard

KK - Extended Save Format exception on 2023(latest) Steam Version KK+AfterParty

Open dreampiggy opened this issue 2 years ago • 2 comments

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:

  1. Download BepisPlugins and extract all to game directory
  2. Run the game and check BepInEx's LogOutput.log
  3. 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.

dreampiggy avatar Feb 18 '23 15:02 dreampiggy

I guess the game update break current patch for function static bool SaveData::<Load>m__4(SaveData+Heroine item)

dreampiggy avatar Feb 18 '23 15:02 dreampiggy

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.

ManlyMarco avatar Feb 18 '23 16:02 ManlyMarco