diff --git a/changelog.md b/changelog.md index d58d27a..30faeb6 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,7 @@ - Added buyUpgrade function (buyUpg still works though) - Added author name to modInfo. +- Fix to crash caused when the name of a subtab or microtab is changed. - Fixes to outdated information in docs. - Improvements to Discord links. - Thank you to thepaperpilot for contributing to this update! diff --git a/js/utils.js b/js/utils.js index 98832a0..3cb85c0 100644 --- a/js/utils.js +++ b/js/utils.js @@ -157,6 +157,15 @@ function fixSave() { { if (player[layer].best !== undefined) player[layer].best = new Decimal (player[layer].best) if (player[layer].total !== undefined) player[layer].total = new Decimal (player[layer].total) + + if (layers[layer].tabFormat && !Array.isArray(layers[layer].tabFormat)) { + + if(!Object.keys(layers[layer].tabFormat).includes(player.subtabs[layer].mainTabs)) player.subtabs[layer].mainTabs = Object.keys(layers[layer].tabFormat)[0] + } + if (layers[layer].microtabs) { + for (item in layers[layer].microtabs) + if(!Object.keys(layers[layer].microtabs[item]).includes(player.subtabs[layer][item])) player.subtabs[layer][item] = Object.keys(layers[layer].microtabs[item])[0] + } } }