Fix a bug where Chart Editor Playtest destroys the vocals and crashes

This commit is contained in:
EliteMasterEric 2024-03-04 21:19:24 -05:00
parent 1f1ccf6256
commit d0f81add95

View file

@ -2787,14 +2787,19 @@ class PlayState extends MusicBeatSubState
// TODO: Uncache the song. // 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(); FlxG.sound.music.pause();
if (vocals != null) vocals.stop(); if (vocals != null)
{
vocals.pause();
remove(vocals);
}
} }
else else
{ {
// Stop and destroy the music.
FlxG.sound.music.pause(); FlxG.sound.music.pause();
if (vocals != null) if (vocals != null)
{ {