Add character savedata migration to sanitize previous alt job titles #5434
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.
About The Pull Request
This change should've been included in #5430, but I forgot.
This adds a migration to save data, to sanitize previous alt job titles solely to those that are allowed. This check will only happen once per character, when they are next loaded, and then never again.
This has the unfortunate side effect of cleaning out any alt job titles that were renamed/removed (which we can consider otherwise valid job titles), but it ensures we only have allowed job titles.
Save file migrations will trigger a local backup of the save data - so if I bugged up something in this code (which I quadruple-checked to ensure I didn't, but still!), the old un-updated save data will be available to be restored.
Changelog
🆑MichiRecRoom
code: Alt job titles will be sanitized the next time your character data is loaded. Most people will be unaffected - but if you used an alt job title that was previously removed or renamed, you may find that said job title is no longer applied. Sorry!
/:cl: