From bef2e9822244687b9bb85a57645ff699a8ed5df3 Mon Sep 17 00:00:00 2001 From: AppleHair <95587502+AppleHair@users.noreply.github.com> Date: Wed, 17 Jul 2024 18:00:07 +0300 Subject: [PATCH] [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. --- source/funkin/play/PlayState.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 450f13300..5bb0decf5 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -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(), }); }