diff --git a/source/funkin/options/TreeMenu.hx b/source/funkin/options/TreeMenu.hx index adca29d9..a136a03f 100644 --- a/source/funkin/options/TreeMenu.hx +++ b/source/funkin/options/TreeMenu.hx @@ -17,9 +17,10 @@ class TreeMenu extends UIState { public var pathDesc:FunkinText; public var pathBG:FlxSprite; - public var lastState:Class = Type.getClass(FlxG.state); + public static var lastState:Class = null; // Static for fixing the softlock bugs when resetting the state - Nex public function new() { + if(lastState == null) lastState = Type.getClass(FlxG.state); super(); } @@ -88,6 +89,7 @@ class TreeMenu extends UIState { public function exit() { FlxG.switchState((lastState != null) ? Type.createInstance(lastState, []) : new MainMenuState()); + lastState = null; } public function onMenuClose(m:OptionsScreen) {