besteon / Ironmon-Tracker

A Lua script for the Bizhawk/mGBA emulator compatible with Pokemon Fire Red, Leaf Green, Ruby, Sapphire, and Emerald that tracks relevant data for the IronMon challenge.
MIT License
129 stars 45 forks source link

Fix for new quickload attempts #413

Closed Fellshadow closed 1 year ago

Fellshadow commented 1 year ago

When testing the quickload changes included in #412 (will want to merge this before that PR) I noticed consistently that swapping to a new settings file for quickload while a tracker-generated rom is currently loaded results in the tracker erroneously carrying over the attempts file from the previous quickload settings file into the new one

Example reproduction steps:

  1. Set up tracker quickload for one particular settings file e.g. RSE Kaizo
  2. Quickload a couple of roms / edit the attempts count to some arbitrary number > 1
  3. Change the quickload settings file to another settings file e.g. RSE Survival while RSE Kaizo AutoRandomized.gba is still loaded in the emulator
  4. Notice how the attempts counter from RSE Kaizo Attempts.txt carries over into RSE Survival Attempts.txt

Went with adding an optional (default false) parameter to force the attempts filepath to be based off the currently set settings file & create a new attempts counter for it if it does not exist. Seems to work fine for me in the above steps but definitely test in case there's a case I didn't catch / it broke elsewhere