From d0f81add959c5418e3dbeb5c61fc933afb0dad51 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Mon, 4 Mar 2024 21:19:24 -0500 Subject: [PATCH] Fix a bug where Chart Editor Playtest destroys the vocals and crashes --- source/funkin/play/PlayState.hx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index d090b4f8a..d7cc1493c 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -2787,14 +2787,19 @@ class PlayState extends MusicBeatSubState // TODO: Uncache the song. } - if (!overrideMusic) + if (overrideMusic) { - // Stop the music. + // Stop the music. Do NOT destroy it, something still references it! FlxG.sound.music.pause(); - if (vocals != null) vocals.stop(); + if (vocals != null) + { + vocals.pause(); + remove(vocals); + } } else { + // Stop and destroy the music. FlxG.sound.music.pause(); if (vocals != null) {