1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-24 14:16:56 +00:00

[BUGFIX] Ensure the variation used for the next song is valid.

When playing in story mode, `PlayState` assumes all the songs use the same variation, which is usually true, but not guaranteed. This PR makes `PlayState` use the `getFirstValidVariation` method to find the valid variation instead of using the `currentVariation` variable, which might not be valid.
This commit is contained in:
AppleHair 2024-07-17 18:00:07 +03:00 committed by EliteMasterEric
parent 68b7610225
commit bef2e98222

View file

@ -2912,7 +2912,7 @@ class PlayState extends MusicBeatSubState
{
targetSong: targetSong,
targetDifficulty: PlayStatePlaylist.campaignDifficulty,
targetVariation: currentVariation,
targetVariation: targetSong.getFirstValidVariation(PlayStatePlaylist.campaignDifficulty),
cameraFollowPoint: cameraFollowPoint.getPosition(),
});
});
@ -2924,7 +2924,7 @@ class PlayState extends MusicBeatSubState
{
targetSong: targetSong,
targetDifficulty: PlayStatePlaylist.campaignDifficulty,
targetVariation: currentVariation,
targetVariation: targetSong.getFirstValidVariation(PlayStatePlaylist.campaignDifficulty),
cameraFollowPoint: cameraFollowPoint.getPosition(),
});
}