From 2226f1f05e5687c9853ccf96d8409e7b9f418ed5 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Thu, 10 Aug 2023 14:04:09 -0400 Subject: [PATCH] Fix an issue where tracknames weren't loading properly --- source/funkin/ui/story/Level.hx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/funkin/ui/story/Level.hx b/source/funkin/ui/story/Level.hx index 83682fec9..7913ac8ca 100644 --- a/source/funkin/ui/story/Level.hx +++ b/source/funkin/ui/story/Level.hx @@ -71,7 +71,12 @@ class Level implements IRegistryEntry { var songList:Array = getSongs() ?? []; var songNameList:Array = songList.map(function(songId) { - return funkin.play.song.SongData.SongDataParser.fetchSong(songId) ?.getDifficulty(difficulty) ?.songName ?? 'Unknown'; + var song:Song = funkin.play.song.SongData.SongDataParser.fetchSong(songId); + if (song == null) return 'Unknown'; + var songDifficulty:SongDifficulty = song.getDifficulty(difficulty); + if (songDifficulty == null) songDifficulty = song.getDifficulty(); + var songName:String = songDifficulty?.songName; + return songName ?? 'Unknown'; }); return songNameList; }