check if sounds are downloaded before play thanks @Atlante45

This commit is contained in:
Thijs Wenker 2015-02-18 18:25:16 +01:00
parent 96b3114a36
commit d10f37291b

View file

@ -20,7 +20,9 @@ SoundArray = function(audioOptions, autoUpdateAudioPosition) {
if (this.autoUpdateAudioPosition) {
this.updateAudioPosition();
}
Audio.playSound(this.sounds[index], this.audioOptions);
if (this.sounds[index].downloaded) {
Audio.playSound(this.sounds[index], this.audioOptions);
}
} else {
print("[ERROR] libraries/soundArray.js:play() : Index " + index + " out of range.");
}