Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions source/funkin/play/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1904,10 +1904,7 @@ class PlayState extends MusicBeatSubState
}
}

if (!startingSong
&& (Math.abs(FlxG.sound.music.time - correctSync) > RESYNC_THRESHOLD
|| Math.abs(playerVoicesError) > RESYNC_THRESHOLD
|| Math.abs(opponentVoicesError) > RESYNC_THRESHOLD))
if (!startingSong && (Math.abs(playerVoicesError) > RESYNC_THRESHOLD || Math.abs(opponentVoicesError) > RESYNC_THRESHOLD))
{
trace('VOCALS NEED RESYNC');
if (vocals != null)
Expand Down Expand Up @@ -2728,16 +2725,12 @@ class PlayState extends MusicBeatSubState
// Skip this if the music is paused (GameOver, Pause menu, start-of-song offset, etc.)
if (!(FlxG.sound.music?.playing ?? false)) return;

var timeToPlayAt:Float = Math.min(FlxG.sound.music.length - 1,
var timeToPlayAt:Float = Math.min(FlxG.sound.music.length,
Math.max(Math.min(Conductor.instance.combinedOffset, 0), Conductor.instance.songPosition) - Conductor.instance.combinedOffset);
trace('Resyncing vocals to ${timeToPlayAt}');

FlxG.sound.music.pause();
vocals.pause();

FlxG.sound.music.time = timeToPlayAt;
FlxG.sound.music.play(false, timeToPlayAt);

vocals.time = timeToPlayAt;
vocals.play(false, timeToPlayAt);
}
Expand Down Expand Up @@ -4119,7 +4112,7 @@ class PlayState extends MusicBeatSubState
var targetTimeMs:Float = Conductor.instance.getStepTimeInMs(targetTimeSteps);

// Don't go back in time to before the song started.
targetTimeMs = Math.max(0, targetTimeMs);
targetTimeMs = Math.min(FlxG.sound.music?.length ?? 0, Math.max(0, targetTimeMs));

if (FlxG.sound.music != null)
{
Expand Down
Loading