1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-25 16:24:40 +00:00

Fix an issue where tracknames weren't loading properly

This commit is contained in:
EliteMasterEric 2023-08-10 14:04:09 -04:00
parent 214c706cac
commit 2226f1f05e

View file

@ -71,7 +71,12 @@ class Level implements IRegistryEntry<LevelData>
{
var songList:Array<String> = getSongs() ?? [];
var songNameList:Array<String> = 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;
}