1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-23 21:56:46 +00:00

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
commit cee5d53deb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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;