mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-01-07 05:22:11 -05:00
[BUGFIX] Prevented infinite recursion on freeplay when a song doesn't have the normal
difficulty
Any attempt to create a song without the `normal` difficulty will result in a silent crash when opening freeplay. After some debugging, I discovered that the issue is caused by infinite recursion, which gets triggered at the start of `FreeplaySongData`'s `updateValues`.
This commit is contained in:
parent
9b483de1da
commit
5e1d25e791
1 changed files with 5 additions and 1 deletions
|
@ -2077,7 +2077,11 @@ class FreeplaySongData
|
||||||
function updateValues(variations:Array<String>):Void
|
function updateValues(variations:Array<String>):Void
|
||||||
{
|
{
|
||||||
this.songDifficulties = song.listDifficulties(null, variations, false, false);
|
this.songDifficulties = song.listDifficulties(null, variations, false, false);
|
||||||
if (!this.songDifficulties.contains(currentDifficulty)) currentDifficulty = Constants.DEFAULT_DIFFICULTY;
|
if (!this.songDifficulties.contains(currentDifficulty) && currentDifficulty != Constants.DEFAULT_DIFFICULTY)
|
||||||
|
{
|
||||||
|
currentDifficulty = Constants.DEFAULT_DIFFICULTY;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var songDifficulty:SongDifficulty = song.getDifficulty(currentDifficulty, null, variations);
|
var songDifficulty:SongDifficulty = song.getDifficulty(currentDifficulty, null, variations);
|
||||||
if (songDifficulty == null) return;
|
if (songDifficulty == null) return;
|
||||||
|
|
Loading…
Reference in a new issue