From 08b50ff98c833aae180a8834c2c7bd3ff8866685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=8D=9A=7ENex?= <87421482+NexIsDumb@users.noreply.github.com> Date: Sat, 2 Mar 2024 18:14:03 +0100 Subject: [PATCH] tree menus softlock when resetting the state fix --- source/funkin/options/TreeMenu.hx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) {