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:
commit
928f941c2f
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue