Fix crash when soundmanager does not load

This commit is contained in:
Cathy J. Fitzpatrick
2013-05-21 01:39:04 -05:00
parent 49f643857d
commit 61e094e5cf

View File

@@ -41,11 +41,15 @@ function BattleSoundLibrary() {
if (this.effectCache[url]) {
return this.effectCache[url];
}
return this.effectCache[url] = soundManager.createSound({
this.effectCache[url] = soundManager.createSound({
id: url,
url: Tools.resourcePrefix + url,
volume: this.effectVolume
});
if (!this.effectCache[url]) {
this.effectCache[url] = this.soundPlaceholder;
}
return this.effectCache[url];
};
this.playEffect = function(url) {
if (!this.mute) this.loadEffect(url).setVolume(this.effectVolume).play();