Merge pull request #686 from FunkinCrew/applehair/freeplay-stack-overflow

[PUBLIC PR] Fix a stack overflow for songs with no "Normal" difficulty
This commit is contained in:
Cameron Taylor
2024-08-20 15:09:36 -04:00
committed by GitHub
+8 -2
View File
@@ -2149,8 +2149,14 @@ class FreeplaySongData
function updateValues(variations:Array<String>):Void
{
this.songDifficulties = song.listSuffixedDifficulties(variations, false, false);
if (!this.songDifficulties.contains(currentDifficulty)) currentDifficulty = Constants.DEFAULT_DIFFICULTY;
this.songDifficulties = song.listDifficulties(null, variations, false, false);
if (!this.songDifficulties.contains(currentDifficulty))
{
currentDifficulty = Constants.DEFAULT_DIFFICULTY;
// This method gets called again by the setter-method
// or the difficulty didn't change, so there's no need to continue.
return;
}
var songDifficulty:SongDifficulty = song.getDifficulty(currentDifficulty, null, variations);
if (songDifficulty == null) return;