harbingerofme / LighterPatcher

Patcher for generated MMHOOK by checking against the plugins
MIT No Attribution
6 stars 1 forks source link

Error Collecting methods from: CaptainShotgunModes #2

Closed Vl4dimyr closed 4 years ago

Vl4dimyr commented 4 years ago

Hey, a user of my mod CaptainShotgunModes reported an issue when loading it with LighterPatcher:

[Info   :LighterPatcher] Collecting methods from: CaptainShotgunModes
[Error  :LighterPatcher] Error on: E:\Games\Steam\steamapps\common\Risk of Rain 2\r2modman\BepInEx\plugins\Vl4dimyr-CaptainShotgunModes\CaptainShotgunModes.dll
[Error  :LighterPatcher] System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
  at System.String.Substring (System.Int32 startIndex, System.Int32 length) [0x0004a] in <2fa7a6a452ca43df998f07fd1486c0df>:0
  at LighterPatcher.Helpers.GetNeededTypes (Mono.Cecil.Cil.Instruction instruction, System.Collections.Generic.List`1[System.String]& typeList) [0x0003b] in <be57066659db4b0daabcb5649b81762a>:0
  at LighterPatcher.LightestPatcher.CollectMethodDefinitions (Mono.Cecil.AssemblyDefinition assembly) [0x0009e] in <be57066659db4b0daabcb5649b81762a>:0
  at LighterPatcher.LightestPatcher.TellBepinAbsolutelyNothingBecauseThePluginsFolderIsntManaged () [0x00092] in <be57066659db4b0daabcb5649b81762a>:0

I guess the bug is around here. But the question is now will you add some checks so this doesn't happen or do you have any suggestion on what I can do or do both of us change something to prevent this from happening? xD

harbingerofme commented 4 years ago

I'll investigate, you do not need to do anything, as this patcher is supposed to be game agnostic so I should support any edge cases.