mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-15 03:35:18 -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
68b7610225
commit
4f46a8e4d0
1 changed files with 5 additions and 2 deletions
|
@ -2150,8 +2150,11 @@ 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)
|
||||
{
|
||||
currentDifficulty = Constants.DEFAULT_DIFFICULTY;
|
||||
}
|
||||
|
||||
var songDifficulty:SongDifficulty = song.getDifficulty(currentDifficulty, null, variations);
|
||||
if (songDifficulty == null) return;
|
||||
|
|
Loading…
Reference in a new issue