[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 GitHub
parent 9b483de1da
commit 4d81aa0fe6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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