@@ -1904,10 +1904,7 @@ class PlayState extends MusicBeatSubState
19041904 }
19051905 }
19061906
1907- if (! startingSong
1908- && (Math .abs (FlxG .sound .music .time - correctSync ) > RESYNC_THRESHOLD
1909- || Math .abs (playerVoicesError ) > RESYNC_THRESHOLD
1910- || Math .abs (opponentVoicesError ) > RESYNC_THRESHOLD ))
1907+ if (! startingSong && (Math .abs (playerVoicesError ) > RESYNC_THRESHOLD || Math .abs (opponentVoicesError ) > RESYNC_THRESHOLD ))
19111908 {
19121909 trace (' VOCALS NEED RESYNC' );
19131910 if (vocals != null )
@@ -2728,16 +2725,12 @@ class PlayState extends MusicBeatSubState
27282725 // Skip this if the music is paused (GameOver, Pause menu, start-of-song offset, etc.)
27292726 if (! (FlxG .sound .music ?. playing ?? false )) return ;
27302727
2731- var timeToPlayAt : Float = Math .min (FlxG .sound .music .length - 1 ,
2728+ var timeToPlayAt : Float = Math .min (FlxG .sound .music .length ,
27322729 Math .max (Math .min (Conductor .instance .combinedOffset , 0 ), Conductor .instance .songPosition ) - Conductor .instance .combinedOffset );
27332730 trace (' Resyncing vocals to ${timeToPlayAt }' );
27342731
2735- FlxG .sound .music .pause ();
27362732 vocals .pause ();
27372733
2738- FlxG .sound .music .time = timeToPlayAt ;
2739- FlxG .sound .music .play (false , timeToPlayAt );
2740-
27412734 vocals .time = timeToPlayAt ;
27422735 vocals .play (false , timeToPlayAt );
27432736 }
@@ -4131,7 +4124,7 @@ class PlayState extends MusicBeatSubState
41314124 var targetTimeMs : Float = Conductor .instance .getStepTimeInMs (targetTimeSteps );
41324125
41334126 // Don't go back in time to before the song started.
4134- targetTimeMs = Math .max (0 , targetTimeMs );
4127+ targetTimeMs = Math .min ( FlxG . sound . music ?. length ?? 0 , Math . max (0 , targetTimeMs ) );
41354128
41364129 if (FlxG .sound .music != null )
41374130 {
0 commit comments