From c4db2a51c7ddf6842ea882c7deccbbca5f29629f Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Sun, 22 Aug 2021 02:00:38 -0500 Subject: [PATCH] Fixed hardReset not updating the active save file --- src/util/save.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/util/save.ts b/src/util/save.ts index e46b561..45ef182 100644 --- a/src/util/save.ts +++ b/src/util/save.ts @@ -187,6 +187,9 @@ window.onbeforeunload = () => { } }; window.save = save; -window.hardReset = () => { - loadSave(newSave()); +window.hardReset = async () => { + 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))))); };