don't try to resync vocals after vocals already ended or song fading out

This commit is contained in:
MtH 2021-04-08 14:17:21 +02:00
parent a2b7f3ade5
commit 1dacbe047d
1 changed files with 11 additions and 1 deletions

View File

@ -62,6 +62,7 @@ class PlayState extends MusicBeatState
var halloweenLevel:Bool = false;
private var vocals:FlxSound;
private var vocalsFinished:Bool = false;
private var dad:Character;
private var gf:Character;
@ -1156,6 +1157,9 @@ class PlayState extends MusicBeatState
else
vocals = new FlxSound();
vocals.onComplete = function(){
vocalsFinished = true;
};
FlxG.sound.list.add(vocals);
notes = new FlxTypedGroup<Note>();
@ -1440,10 +1444,16 @@ class PlayState extends MusicBeatState
function resyncVocals():Void
{
vocals.pause();
if (_exiting)
return ;
vocals.pause();
FlxG.sound.music.play();
Conductor.songPosition = FlxG.sound.music.time;
if (vocalsFinished)
return ;
vocals.time = Conductor.songPosition;
vocals.play();
}