Fixed an possible sounds issue

This commit is contained in:
WolverinDEV 2019-02-23 15:09:05 +01:00
parent 97a4ca8a9b
commit fd02eee9c1

View file

@ -240,6 +240,10 @@ namespace sound {
const path = "audio/" + file.filename;
const context = audio.player.context();
if(!context) {
console.warn(tr("Tried to replay a sound without an audio context (Sound: %o). Dropping playback"), sound);
return;
}
const volume = get_sound_volume(sound, options.default_volume);
console.log(tr("Replaying sound %s (Sound volume: %o | Master volume %o)"), sound, volume, master_volume);