Creating AudioFile in audio loader method and adding it if it's not null

Returning loader reference for call chaining
This commit is contained in:
Pavle Goloskokovic 2017-11-30 18:03:16 +01:00
parent 8de108ce68
commit 8dc987b7fc

View file

@ -94,7 +94,14 @@ var Loader = new Class({
// config can include: instances
audio: function (key, urls, config, xhrSettings)
{
return AudioFile.create(this, key, urls, config, xhrSettings);
var audioFile = AudioFile.create(this, key, urls, config, xhrSettings);
if(audioFile)
{
this.addFile(audioFile);
}
return this;
},
tilemapCSV: function (key, url, xhrSettings)