Skip to content

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

@dreampiggy

Description

@dreampiggy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions