diff options
| author | stonedDiscord <Tukz@gmx.de> | 2026-01-01 17:46:49 +0100 |
|---|---|---|
| committer | stonedDiscord <Tukz@gmx.de> | 2026-01-01 17:46:49 +0100 |
| commit | 89d7319e4ae2d6466902cc3cea0c221b33f0e9dc (patch) | |
| tree | c57a7e0aac1a0a0f2d1e735d7347edefa51cd324 | |
| parent | 19855fa729af4551d17672e2be3f57884f3d5e0c (diff) | |
bring back objection sounds for chars that dont have their own
| -rw-r--r-- | webAO/viewport/utils/handleICSpeaking.ts | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/webAO/viewport/utils/handleICSpeaking.ts b/webAO/viewport/utils/handleICSpeaking.ts index cf75a80..6cf665c 100644 --- a/webAO/viewport/utils/handleICSpeaking.ts +++ b/webAO/viewport/utils/handleICSpeaking.ts @@ -12,6 +12,7 @@ import transparentPng from "../../constants/transparentPng"; import { COLORS } from "../constants/colors"; import mlConfig from "../../utils/aoml"; import request from "../../services/request"; +import fileExists from "../../utils/fileExists"; let attorneyMarkdown: ReturnType<typeof mlConfig> | null = null; @@ -166,11 +167,8 @@ export const handle_ic_speaking = async (playerChatMsg: ChatMsg) => { const perCharPath = `${AO_HOST}characters/${encodeURI( client.viewport.getChatmsg().name.toLowerCase(), )}/${shout}.opus`; - client.viewport.shoutaudio.src = perCharPath; - client.viewport.shoutaudio.onerror = () => { - client.viewport.shoutaudio.src = client.resources[shout].sfx; - client.viewport.shoutaudio.play(); - }; + const exists = await fileExists(perCharPath); + client.viewport.shoutaudio.src = exists ? perCharPath : client.resources[shout].sfx; client.viewport.shoutaudio.play(); client.viewport.setShoutTimer(client.resources[shout].duration); } else { |
