colinator27 / DogScepter

A work-in-progress modding tool geared toward UNDERTALE/DELTARUNE
MIT License
45 stars 15 forks source link

ArgumentOutOfRangeException trying to insert "Switch" Nodes #41

Open Miepee opened 2 years ago

Miepee commented 2 years ago

Multiple games generate the following stacktrace trying to decompile code:

Failed to decompile code for "gml_Script_gml_builder_build_outer": System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at System.Collections.Generic.List`1.RemoveAt(Int32 index)
   at DogScepterLib.Project.GML.Decompiler.SwitchStatements.InsertNode(DecompileContext ctx, SwitchStatement s) in C:\Users\narr\gitrepos\dog-scepter\DogScepterLib\Project\GML\Decompiler\SwitchStatements.cs:line 352
   at DogScepterLib.Project.GML.Decompiler.BranchStatements.InsertNodes(DecompileContext ctx) in C:\Users\narr\gitrepos\dog-scepter\DogScepterLib\Project\GML\Decompiler\BranchStatements.cs:line 28
   at DogScepterLib.Project.GML.Decompiler.DecompileContext.DecompileSegment(GMCode codeEntry, BlockList existingList) in C:\Users\narr\gitrepos\dog-scepter\DogScepterLib\Project\GML\Decompiler\DecompileContext.cs:line 242
   at DogScepterLib.Project.GML.Decompiler.DecompileContext.DecompileWholeEntry(GMCode codeEntry) in C:\Users\narr\gitrepos\dog-scepter\DogScepterLib\Project\GML\Decompiler\DecompileContext.cs:line 207
   at DogScepterLib.Project.GML.Decompiler.DecompileContext.DecompileWholeEntryString(GMCode codeEntry) in C:\Users\narr\gitrepos\dog-scepter\DogScepterLib\Project\GML\Decompiler\DecompileContext.cs:line 186
   at DogScepterCLI.Commands.DumpCommand.<>c__DisplayClass36_1.<ExecuteAsync>b__0(GMCode elem) in C:\Users\narr\gitrepos\dog-scepter\DogScepterCLI\Commands\DumpCommand.cs:line 199

Some games are: Hey diddle diddle, moebius well, feed the gresskar, hectic harvest, blabbering buccaneers, butterflies, sinder the sine wave dating app,