A fix requested by Eric

This commit is contained in:
AppleHair 2024-07-23 11:34:26 +03:00 committed by GitHub
parent 4d81aa0fe6
commit c8caeb42de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2959,11 +2959,16 @@ class PlayState extends MusicBeatSubState
FunkinSound.playOnce(Paths.sound('Lights_Shut_off'), function() {
// no camFollow so it centers on horror tree
var targetSong:Song = SongRegistry.instance.fetchEntry(targetSongId);
var targetVariation:String = currentVariation;
if (!targetSong.hasDifficulty(PlayStatePlaylist.campaignDifficulty, currentVariation))
{
targetVariation = targetSong.getFirstValidVariation(PlayStatePlaylist.campaignDifficulty) ?? Constants.DEFAULT_VARIATION;
}
LoadingState.loadPlayState(
{
targetSong: targetSong,
targetDifficulty: PlayStatePlaylist.campaignDifficulty,
targetVariation: targetSong.getFirstValidVariation(PlayStatePlaylist.campaignDifficulty),
targetVariation: targetVariation,
cameraFollowPoint: cameraFollowPoint.getPosition(),
});
});
@ -2971,11 +2976,16 @@ class PlayState extends MusicBeatSubState
else
{
var targetSong:Song = SongRegistry.instance.fetchEntry(targetSongId);
var targetVariation:String = currentVariation;
if (!targetSong.hasDifficulty(PlayStatePlaylist.campaignDifficulty, currentVariation))
{
targetVariation = targetSong.getFirstValidVariation(PlayStatePlaylist.campaignDifficulty) ?? Constants.DEFAULT_VARIATION;
}
LoadingState.loadPlayState(
{
targetSong: targetSong,
targetDifficulty: PlayStatePlaylist.campaignDifficulty,
targetVariation: targetSong.getFirstValidVariation(PlayStatePlaylist.campaignDifficulty),
targetVariation: targetVariation,
cameraFollowPoint: cameraFollowPoint.getPosition(),
});
}