[Bugfix] Prevent crash in audio editor when shuffling over old CVar format#3337
Conversation
|
Should be done now. |
…tion which checks for previous format with `CVarGet` to know if it needs clearing before setting either the lock or the sequence
|
Any reason to do this over just a one time clearing/transforming of the old CVars via the config migrator? Seems like the migrator would serve this purpose better. |
|
It felt like overkill to use a migrator version just for a single wipe like that. Unless I'm missing something and we can version CVar subsections like the audio editor group. |
|
That being said, if we don't care about frequently updating the migrator version (and bloating the code with single-line migrations like that), I don't mind changing the approach. |
|
Versions are free. It's just a number, making it big is fine |
|
Honestly, it's more the migrator function bloat I'm worried about. I wish we had a better way of handling that. |
In that case it may be a good idea to also change the quest stuff in the save files; currently instead of |
|
That would be a different migrator, honestly. Probably needs a new SaveManager load function version, unfortunately. |
|
I'm sure there's a way to clean up the bloat. I'd be more worried about having support for old configs living in places other than migrations than bloat (because at least with bloat there's just one bloated thing to clean up) |
|
We could have a minimum supported version for upgrading. |
I'd prefer we avoid this. I remember pushing to have the logic be
this aligns with how database migration scripts work |
|
I'm also in favor of incremental upgrades but I think that at some point we should remove support for old versions (for example remove the v1-v2 & v2-v3 convertors and give an error on the file select screen if a v1 or a v2 is attempted to be loaded). |
…uenceMap` and just clears everything from there in "gAudioEditor.ReplacedSequences"
|
Alright, it's a migrator now. |
Archez
left a comment
There was a problem hiding this comment.
Nice and simple! Thankfully the config updater runs after the audio collection instance is setup 🚀
Converts all lock and replacement
CVarSetIntegercalls to a custom function that checks for previousCVarformat withCVarGetand checking fornullptr. If it's not, then it's not an object like the new one. It then clears the oldCVarformat before actually saving.Build Artifacts