diff options
| author | sD <stoned@derpymail.org> | 2020-03-08 18:01:49 +0100 |
|---|---|---|
| committer | sD <stoned@derpymail.org> | 2020-03-08 18:01:49 +0100 |
| commit | d4f6f89b22a0cb84c85a3ace8f814a5e65189571 (patch) | |
| tree | 0ffc12317d60e6e24985ee81008f0bb8a3194a8f /webAO | |
| parent | 3e93acbc7b6f08fc35ebfbeb3b75f3a71370ed3b (diff) | |
get default objection sfx if character doesn't have one
Diffstat (limited to 'webAO')
| -rw-r--r-- | webAO/client.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/webAO/client.js b/webAO/client.js index 95b3a5f..5999bfe 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -1386,7 +1386,13 @@ async changeBackground(position) { chatContainerBox.style.display = "none"; shoutSprite.src = client.resources[shout]["src"]; shoutSprite.style.display = "block"; - this.shoutaudio.src = `${AO_HOST}characters/${encodeURI(this.chatmsg.name.toLowerCase())}/${shout}.wav`; + + const { url: shoutUrl } = await this.oneSuccess([ + this.rejectOnError(fetch(`${AO_HOST}characters/${encodeURI(this.chatmsg.name.toLowerCase())}/${shout}.wav`)), + this.rejectOnError(fetch(`${AO_HOST}misc/default/objection.wav`)) + ]); + + this.shoutaudio.src = shoutUrl; this.shoutaudio.play(); this.shoutTimer = 850; } else { |
