MrMarble / drg-editor

Deep Rock galactic save editor
MIT License
42 stars 42 forks source link

Fix uint8array infinite loop #17

Closed JackNewman12 closed 1 year ago

JackNewman12 commented 1 year ago

I found that whenever I would load a save file the page would freeze.

No idea if my save files are different (I tried multiple), but once it got to the end of the file indexOf() would not find the needle and return -1, which restarts the for loop.

I only looked at the code I needed for the fix so no idea if this breaks some edge cases, but it seems to work for me.

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
drg-editor ✅ Ready (Inspect) Visit Preview Oct 23, 2022 at 1:04AM (UTC)
MrMarble commented 1 year ago

Nice catch, would you mind sharing your save file, so I can do some testing as to why that happened? I know the game skips parts of the save if you don't have them, e.g. overclocks, but I thought I had it handled.

You can send the save by email if don't want to it public

JackNewman12 commented 1 year ago

Sent via email since I have no idea if they contain any private data.

MrMarble commented 1 year ago

Ok, just saw the problem with your save files, looks like resources are also omitted from the file if you don't own any of them, in your case is error cubes.

Thanks for the fix!