mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-09-11 20:57:20 +00:00
Fix an occasional bug where "default" will be used over "" causing a crash on song load. (#135)
This commit is contained in:
parent
21f44edf1d
commit
cb81371b4a
|
@ -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`.
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue