From 2fbc2bd0a15d87b7b605eb77167a48f536acbe8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=8D=9A=7ENex?= <87421482+NexIsDumb@users.noreply.github.com> Date: Mon, 14 Apr 2025 03:38:14 +0200 Subject: [PATCH] oops --- source/funkin/editors/charter/Charter.hx | 4 ++-- source/funkin/game/PlayState.hx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index f1216902..7c111dbe 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -1541,8 +1541,8 @@ class Charter extends UIState { if (shouldBuild && instance != null) instance.buildChart(); var cur = FlxG.state; while(true) { - if (cur.subState != null) cur = cur.subState; - else return cur.openSubState(new SaveSubstate(Json.stringify(data, replacer, space), options, saveOptions)); + if (instance != null || cur.subState == null) return cur.openSubState(new SaveSubstate(Json.stringify(data, replacer, space), options, saveOptions)); + else cur = cur.subState; } } diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 4d48ae6d..f4e6f04c 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -826,7 +826,7 @@ class PlayState extends MusicBeatState SaveWarning.showWarning = Charter.undos.unsaved; SaveWarning.selectionClass = CharterSelection; SaveWarning.warningFunc = saveWarn; - SaveWarning.saveFunc = () -> Charter.saveEverything(false); + SaveWarning.saveFunc = () -> Charter.saveEverything(false); } }