Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Fix the Random Button in FreeplayState not being able to switch to Erect/Nightmare songs #3838

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion source/funkin/ui/freeplay/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ class FreeplayState extends MusicBeatSubState
*/
public static var rememberedVariation:String = Constants.DEFAULT_VARIATION;

var allDifficulties:Array<String> = Constants.DEFAULT_DIFFICULTY_LIST_FULL;

var funnyCam:FunkinCamera;
var rankCamera:FunkinCamera;
var rankBg:FunkinSprite;
Expand Down Expand Up @@ -638,6 +640,16 @@ class FreeplayState extends MusicBeatSubState
onDJIntroDone();
}

allDifficulties = [];
for (song in songs)
{
if (song == null) continue;
for (diff in song.data.listDifficulties(null, song.data.getVariationsByCharacterId(rememberedCharacterId)))
{
if (!allDifficulties.contains(diff)) allDifficulties.push(diff);
}
}

// Generates song list with the starter params (who our current character is, last remembered difficulty, etc.)
generateSongList(null, false);

Expand Down Expand Up @@ -1697,7 +1709,7 @@ class FreeplayState extends MusicBeatSubState

// Gets all available difficulties for our character, via our available variations
var difficultiesAvailable:Array<String> = grpCapsules.members[curSelected].freeplayData?.data.listDifficulties(null,
characterVariations) ?? Constants.DEFAULT_DIFFICULTY_LIST;
characterVariations) ?? allDifficulties;

var currentDifficultyIndex:Int = difficultiesAvailable.indexOf(currentDifficulty);

Expand Down
Loading