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

Merge pull request #331 from FunkinCrew/bugfix/countdown-pause-music

Fix issue with incorrect music after pausing during countdown
This commit is contained in:
Cameron Taylor 2024-02-16 17:36:23 -05:00 committed by GitHub
commit 928f941c2f

View file

@ -354,6 +354,11 @@ class PlayState extends MusicBeatSubState
*/
var startingSong:Bool = false;
/**
* False if `FlxG.sound.music`
*/
var musicPausedBySubState:Bool = false;
/**
* False until `create()` has completed.
*/
@ -1042,6 +1047,7 @@ class PlayState extends MusicBeatSubState
// Pause the music.
if (FlxG.sound.music != null)
{
musicPausedBySubState = FlxG.sound.music.playing;
FlxG.sound.music.pause();
if (vocals != null) vocals.pause();
}
@ -1049,7 +1055,6 @@ class PlayState extends MusicBeatSubState
// Pause the countdown.
Countdown.pauseCountdown();
}
else {}
super.openSubState(subState);
}
@ -1069,7 +1074,10 @@ class PlayState extends MusicBeatSubState
if (event.eventCanceled) return;
// Resume
if (musicPausedBySubState)
{
FlxG.sound.music.play(FlxG.sound.music.time);
}
if (FlxG.sound.music != null && !startingSong && !isInCutscene) resyncVocals();