Skip to content

Commit

Permalink
tree menus softlock when resetting the state fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NexIsDumb committed Mar 2, 2024
1 parent fa22994 commit 08b50ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/funkin/options/TreeMenu.hx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ class TreeMenu extends UIState {
public var pathDesc:FunkinText;
public var pathBG:FlxSprite;

public var lastState:Class<FlxState> = Type.getClass(FlxG.state);
public static var lastState:Class<FlxState> = null; // Static for fixing the softlock bugs when resetting the state - Nex

public function new() {
if(lastState == null) lastState = Type.getClass(FlxG.state);
super();
}

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 08b50ff

Please sign in to comment.