ShadowTheAge / yafc

Powerful Factorio calculator/analyser that works with mods
GNU General Public License v3.0
174 stars 56 forks source link

[BUG] IndexOutOfRangeException on the milestone editor #165

Open Akronymus-git opened 2 years ago

Akronymus-git commented 2 years ago

Reproduction step: Remove one item from the milestone editor then click auto sort milestones. Version v0.5.8.0 OS: Windows 10

Stacktrace:

Index was outside the bounds of the array.

at YAFC.Model.Milestones.ComputeWithParameters(Project project, ErrorCollector warnings, FactorioObject[] milestones, Boolean autoSort) in C:\projects\YAFC\YAFCmodel\Analysis\Milestones.cs:line 145 at YAFC.MilestonesEditor.Build(ImGui gui) in C:\projects\YAFC\YAFC\Windows\MilestonesEditor.cs:line 67 at YAFC.UI.ImGui.DoGui(ImGuiAction action) in C:\projects\YAFC\YAFCui\ImGui\ImGuiBuilding.cs:line 182 at YAFC.UI.ImGui.MouseUp(Int32 button) in C:\projects\YAFC\YAFCui\ImGui\ImGuiBuilding.cs:line 257 at YAFC.UI.InputSystem.MouseUp(Int32 button) in C:\projects\YAFC\YAFCui\Core\InputSystem.cs:line 163 at YAFC.UI.Ui.ProcessEvents() in C:\projects\YAFC\YAFCui\Core\Ui.cs:line 100

ShadowTheAge commented 2 years ago

Thanks for the report, I will check it. Unfrtunately, due to rl issues, the development is now slow.

DaleStan commented 2 years ago

@ChristophGra I can't reproduce this in either 0.5.8 or master. What mods and milestones were you using?

Akronymus-git commented 2 years ago

mod-list.txt

My mods. And no particular milestone.

DaleStan commented 2 years ago

I still can't reproduce this. I deleted several milestones with no issues. Will you attach a new save instead, please? Also, will you attach a YAFC file if it doesn't happen in an empty project?

Akronymus-git commented 2 years ago

https://www.youtube.com/watch?v=JozPXezP-xY project.txt the .yafc file, but renamed as .txt because otherwise I cant upload it. debug_save.zip the save

DaleStan commented 2 years ago

I can reproduce this now, but fixing it turned out to be beyond me. Something's weird about your selection of milestones, but that's all I can say for sure.