mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-11-14 19:05:15 +00:00
fix: fix the user song offsets being applied incorrectly
This commit is contained in:
parent
39b1a42cfe
commit
410cfe972d
|
@ -413,7 +413,7 @@ class Conductor
|
|||
}
|
||||
|
||||
// Take into account instrumental and file format song offsets.
|
||||
songPos += applyOffsets ? (instrumentalOffset + formatOffset + audioVisualOffset) : 0;
|
||||
songPos += applyOffsets ? (combinedOffset) : 0;
|
||||
|
||||
var oldMeasure:Float = this.currentMeasure;
|
||||
var oldBeat:Float = this.currentBeat;
|
||||
|
|
|
@ -1457,11 +1457,34 @@ class PlayState extends MusicBeatSubState
|
|||
if (FlxG.sound.music != null)
|
||||
{
|
||||
var correctSync:Float = Math.min(FlxG.sound.music.length, Math.max(0, Conductor.instance.songPosition - Conductor.instance.combinedOffset));
|
||||
var playerVoicesError:Float = 0;
|
||||
var opponentVoicesError:Float = 0;
|
||||
|
||||
if (!startingSong && (Math.abs(FlxG.sound.music.time - correctSync) > 5 || Math.abs(vocals.checkSyncError(correctSync)) > 5))
|
||||
if (vocals != null)
|
||||
{
|
||||
@:privateAccess // todo: maybe make the groups public :thinking:
|
||||
{
|
||||
vocals.playerVoices.forEachAlive(function(voice:FunkinSound) {
|
||||
var currentRawVoiceTime:Float = voice.time + vocals.playerVoicesOffset;
|
||||
if (Math.abs(currentRawVoiceTime - correctSync) > Math.abs(playerVoicesError)) playerVoicesError = currentRawVoiceTime - correctSync;
|
||||
});
|
||||
|
||||
vocals.opponentVoices.forEachAlive(function(voice:FunkinSound) {
|
||||
var currentRawVoiceTime:Float = voice.time + vocals.opponentVoicesOffset;
|
||||
if (Math.abs(currentRawVoiceTime - correctSync) > Math.abs(opponentVoicesError)) opponentVoicesError = currentRawVoiceTime - correctSync;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (!startingSong
|
||||
&& (Math.abs(FlxG.sound.music.time - correctSync) > 5 || Math.abs(playerVoicesError) > 5 || Math.abs(opponentVoicesError) > 5))
|
||||
{
|
||||
trace("VOCALS NEED RESYNC");
|
||||
if (vocals != null) trace(vocals.checkSyncError(correctSync));
|
||||
if (vocals != null)
|
||||
{
|
||||
trace(playerVoicesError);
|
||||
trace(opponentVoicesError);
|
||||
}
|
||||
trace(FlxG.sound.music.time);
|
||||
trace(correctSync);
|
||||
resyncVocals();
|
||||
|
|
Loading…
Reference in a new issue