mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-11-10 00:34:40 +00:00
don't try to resync vocals after vocals already ended or song fading out
This commit is contained in:
parent
10bb5d8a30
commit
729d48707d
|
@ -62,6 +62,7 @@ class PlayState extends MusicBeatState
|
||||||
var halloweenLevel:Bool = false;
|
var halloweenLevel:Bool = false;
|
||||||
|
|
||||||
private var vocals:FlxSound;
|
private var vocals:FlxSound;
|
||||||
|
private var vocalsFinished:Bool = false;
|
||||||
|
|
||||||
private var dad:Character;
|
private var dad:Character;
|
||||||
private var gf:Character;
|
private var gf:Character;
|
||||||
|
@ -1156,6 +1157,9 @@ class PlayState extends MusicBeatState
|
||||||
else
|
else
|
||||||
vocals = new FlxSound();
|
vocals = new FlxSound();
|
||||||
|
|
||||||
|
vocals.onComplete = function(){
|
||||||
|
vocalsFinished = true;
|
||||||
|
};
|
||||||
FlxG.sound.list.add(vocals);
|
FlxG.sound.list.add(vocals);
|
||||||
|
|
||||||
notes = new FlxTypedGroup<Note>();
|
notes = new FlxTypedGroup<Note>();
|
||||||
|
@ -1440,10 +1444,16 @@ class PlayState extends MusicBeatState
|
||||||
|
|
||||||
function resyncVocals():Void
|
function resyncVocals():Void
|
||||||
{
|
{
|
||||||
vocals.pause();
|
if (_exiting)
|
||||||
|
return ;
|
||||||
|
|
||||||
|
vocals.pause();
|
||||||
FlxG.sound.music.play();
|
FlxG.sound.music.play();
|
||||||
Conductor.songPosition = FlxG.sound.music.time;
|
Conductor.songPosition = FlxG.sound.music.time;
|
||||||
|
|
||||||
|
if (vocalsFinished)
|
||||||
|
return ;
|
||||||
|
|
||||||
vocals.time = Conductor.songPosition;
|
vocals.time = Conductor.songPosition;
|
||||||
vocals.play();
|
vocals.play();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue