Skip to content

Commit

Permalink
fixed the bug syncing in every frame when legacy vocal is null
Browse files Browse the repository at this point in the history
  • Loading branch information
HRK-EXEX committed Jan 6, 2025
1 parent fa40078 commit 6588b51
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion source/backend/CoolUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ class CoolUtil
} else {
// Larger than 1
if (str.length == prec) result = str;
else result = str.substr(0, str.length-prec) + (prec > 0 ? '.'+str.substr(str.length-prec) : '');
else {
result = str.substr(0, str.length-prec) + (prec > 0 ? '.'+str.substr(str.length-prec) : '');
}
}
} else {
str = ''+Math.fround(
Expand Down
11 changes: 7 additions & 4 deletions source/states/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1680,6 +1680,7 @@ class PlayState extends MusicBeatState
gfSide = !songData.isOldVersion;

curSong = songData.song;
bfVocal = opVocal = false;

vocals = opponentVocals = null;
try
Expand All @@ -1691,8 +1692,10 @@ class PlayState extends MusicBeatState
{
var playerVocals = Paths.voices(songData.song,
(boyfriend.vocalsFile == null || boyfriend.vocalsFile.length < 1) ? 'Player' : boyfriend.vocalsFile);
vocals = new FlxSound().loadEmbedded(playerVocals);
bfVocal = true;
if (playerVocals != null && playerVocals.length > 0) {
vocals = new FlxSound().loadEmbedded(playerVocals);
bfVocal = true;
}

var oppVocals = Paths.voices(songData.song, (dad.vocalsFile == null || dad.vocalsFile.length < 1) ? 'Opponent' : dad.vocalsFile);
if (oppVocals != null && oppVocals.length > 0) {
Expand All @@ -1701,9 +1704,9 @@ class PlayState extends MusicBeatState
}
} else {
vocals = new FlxSound().loadEmbedded(legacyVoices);
bfVocal = true;
bfVocal = vocals != null;
}
}
}
} catch (e:Dynamic) {}

#if FLX_PITCH
Expand Down

0 comments on commit 6588b51

Please sign in to comment.