mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-23 08:07:54 -05:00
Disable song previews for mod songs rather than crashing the game
This commit is contained in:
parent
007ec95e85
commit
9e0a993746
1 changed files with 15 additions and 8 deletions
|
@ -377,7 +377,7 @@ class FunkinSound extends FlxSound implements ICloneable<FunkinSound>
|
||||||
FlxG.sound.music = partialMusic;
|
FlxG.sound.music = partialMusic;
|
||||||
FlxG.sound.list.remove(FlxG.sound.music);
|
FlxG.sound.list.remove(FlxG.sound.music);
|
||||||
|
|
||||||
if (params.onLoad != null) params.onLoad();
|
if (FlxG.sound.music != null && params.onLoad != null) params.onLoad();
|
||||||
});
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -488,6 +488,12 @@ class FunkinSound extends FlxSound implements ICloneable<FunkinSound>
|
||||||
|
|
||||||
var soundRequest = FlxPartialSound.partialLoadFromFile(path, start, end);
|
var soundRequest = FlxPartialSound.partialLoadFromFile(path, start, end);
|
||||||
|
|
||||||
|
if (soundRequest == null)
|
||||||
|
{
|
||||||
|
promise.complete(null);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
promise.future.onError(function(e) {
|
promise.future.onError(function(e) {
|
||||||
soundRequest.error("Sound loading was errored or cancelled");
|
soundRequest.error("Sound loading was errored or cancelled");
|
||||||
});
|
});
|
||||||
|
@ -496,6 +502,7 @@ class FunkinSound extends FlxSound implements ICloneable<FunkinSound>
|
||||||
var snd = FunkinSound.load(partialSound, volume, looped, autoDestroy, autoPlay, onComplete, onLoad);
|
var snd = FunkinSound.load(partialSound, volume, looped, autoDestroy, autoPlay, onComplete, onLoad);
|
||||||
promise.complete(snd);
|
promise.complete(snd);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue