From f6dafffb1e6c7227d83d5b89a02abd96a611f1a6 Mon Sep 17 00:00:00 2001 From: JordanSantiagoYT Date: Sat, 24 Feb 2024 23:33:57 -0500 Subject: [PATCH] E Fixed a funny bug where you could crash any editor by opening an editor and immediately exiting before the editor song starts The note offset state now changes to the correct menu music when you exit --- source/editors/EditingMusic.hx | 3 ++- source/options/NoteOffsetState.hx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/editors/EditingMusic.hx b/source/editors/EditingMusic.hx index 3a2e7c8eda2..4713d8e696c 100644 --- a/source/editors/EditingMusic.hx +++ b/source/editors/EditingMusic.hx @@ -44,7 +44,8 @@ class EditingMusic } public function destroy() { - music.destroy(); + if (startTimer != null) startTimer.cancel(); + if (music != null) music.destroy(); reset(); } public function playMusic(time:Float = 0) diff --git a/source/options/NoteOffsetState.hx b/source/options/NoteOffsetState.hx index 1589fd102d3..2440fb2e5e3 100644 --- a/source/options/NoteOffsetState.hx +++ b/source/options/NoteOffsetState.hx @@ -356,7 +356,7 @@ class NoteOffsetState extends MusicBeatState persistentUpdate = false; CustomFadeTransition.nextCamera = camOther; FlxG.switchState(options.OptionsState.new); - FlxG.sound.playMusic(Paths.music('freakyMenu'), 1, true); + FlxG.sound.playMusic(Paths.music('freakyMenu-' + ClientPrefs.daMenuMusic), 1, true); FlxG.mouse.visible = false; }