1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-04 13:54:22 +00:00

Fix an audio crash when exiting a cutscene

This commit is contained in:
EliteMasterEric 2024-03-25 21:08:39 -04:00
parent 0409c0ba6a
commit 07ad250060

View file

@ -2941,7 +2941,10 @@ class PlayState extends MusicBeatSubState
if (overrideMusic)
{
// Stop the music. Do NOT destroy it, something still references it!
FlxG.sound.music.pause();
if (FlxG.sound.music != null)
{
FlxG.sound.music.pause();
}
if (vocals != null)
{
vocals.pause();
@ -2951,7 +2954,10 @@ class PlayState extends MusicBeatSubState
else
{
// Stop and destroy the music.
FlxG.sound.music.pause();
if (FlxG.sound.music != null)
{
FlxG.sound.music.pause();
}
if (vocals != null)
{
vocals.destroy();