Fixed hardReset not updating the active save file

This commit is contained in:
thepaperpilot 2021-08-22 02:00:38 -05:00
parent 11df9853d0
commit c4db2a51c7

View file

@ -187,6 +187,9 @@ window.onbeforeunload = () => {
} }
}; };
window.save = save; window.save = save;
window.hardReset = () => { window.hardReset = async () => {
loadSave(newSave()); await loadSave(newSave());
const modData = JSON.parse(decodeURIComponent(escape(atob(localStorage.getItem(modInfo.id)!))));
modData.active = player.id;
localStorage.setItem(modInfo.id, btoa(unescape(encodeURIComponent(JSON.stringify(modData)))));
}; };