Fix: Rando quest selection falling back to vanilla saves #2599
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When only an MQ rom is provided and a MQ save or rando save is created, then deleted, If you try to create a new rando save on top of the same deleted file slot, it will fail to be a rando save and fall back to a vanilla savefile.
This is due to a broken check during file creation that first checks for the quest mode to be rando, and then checks the filemetainfo to see if it relies on master quest. The check is broken as it compares
requiresMasterQuestagainst bothResourceMgr_GameHasMasterQuest()andResourceMgr_GameHasOriginal(). I think the intent of this check was to not allow a rando save be created if the spoiler log depended on a rom that isn't available.The issue with this check is that the fileMetaInfo is not considered valid until after the save is created. So checking during save init is wrong as the values will not be correct. The reason why it seemed to work today is because on SoH launch, the fileMetaInfo is 0, and the check is broken so everything succeeds. And if a vanilla rom is provided, then again because of the broken check everything succeeds. Only when deleting a save and creating ontop with only a MQ rom does the issue arise, as deleting a save does not fully clear the fileMetaInfo.
This PR removes the broken check entirely as since fileMetaInfo is not valid until after the save is created, it can't be relied on. I updated the file delete method to at least clear out the
requiresXproperties of the fileMetaInfo just to reduce future headaches.In my opinion, it is ok to remove this check. If someone loads a spoiler log that requires a rom they dont have, I think it makes more sense to allow the file to be created as expected and then grey it out, rather than turning it into a vanilla save unexpectedly.
Fixes #2595
For context, the broken check is the following
VS what I think it was intended to be
But as I said, we can't rely on the fileMetaInfo here anyways
Build Artifacts