From d4f6f89b22a0cb84c85a3ace8f814a5e65189571 Mon Sep 17 00:00:00 2001 From: sD Date: Sun, 8 Mar 2020 18:01:49 +0100 Subject: get default objection sfx if character doesn't have one --- webAO/client.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'webAO') 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 { -- cgit