1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-30 16:56:47 +00:00

Fix an occasional bug where "default" will be used over "" causing a crash on song load. (#135)

This commit is contained in:
Eric 2023-08-28 15:07:51 -04:00 committed by GitHub
parent 21f44edf1d
commit cb81371b4a
2 changed files with 3 additions and 3 deletions

View file

@ -361,7 +361,7 @@ class SongDifficulty
public inline function playInst(volume:Float = 1.0, looped:Bool = false):Void
{
var suffix:String = (variation ?? '') != '' ? '-$variation' : '';
var suffix:String = (variation != null && variation != '' && variation != 'default') ? '-$variation' : '';
FlxG.sound.playMusic(Paths.inst(this.song.songId, suffix), volume, looped);
}
@ -392,7 +392,7 @@ class SongDifficulty
return [];
}
var suffix:String = (variation ?? '') != '' ? '-$variation' : '';
var suffix:String = (variation != null && variation != '' && variation != 'default') ? '-$variation' : '';
// Automatically resolve voices by removing suffixes.
// For example, if `Voices-bf-car.ogg` does not exist, check for `Voices-bf.ogg`.

View file

@ -242,7 +242,7 @@ class SongDataParser
static function loadSongChartDataFile(songPath:String, variation:String = ''):String
{
var songChartDataFilePath:String = (variation != '' || variation == 'default') ? Paths.json('$SONG_DATA_PATH$songPath/$songPath-chart-$variation') : Paths.json('$SONG_DATA_PATH$songPath/$songPath-chart');
var songChartDataFilePath:String = (variation != '' && variation != 'default') ? Paths.json('$SONG_DATA_PATH$songPath/$songPath-chart-$variation') : Paths.json('$SONG_DATA_PATH$songPath/$songPath-chart');
var rawJson:String = Assets.getText(songChartDataFilePath).trim();