From 3162071cb27510954dde918af629ed5d75deb583 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Wed, 3 Sep 2025 08:39:19 +0200 Subject: get list of extensions to try from host --- webAO/client/handleCharacterInfo.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'webAO/client/handleCharacterInfo.ts') diff --git a/webAO/client/handleCharacterInfo.ts b/webAO/client/handleCharacterInfo.ts index 3f81e57..a364b5e 100644 --- a/webAO/client/handleCharacterInfo.ts +++ b/webAO/client/handleCharacterInfo.ts @@ -6,13 +6,13 @@ import fileExists from "../utils/fileExists"; import { AO_HOST } from "./aoHost"; export const getCharIcon = async (img: HTMLImageElement, charname: string) => { - const extensions = [".png", ".webp"]; + const charicon_extensions = [".png", ".webp"]; img.alt = charname; const charIconBaseUrl = `${AO_HOST}characters/${encodeURI( charname.toLowerCase(), )}/char_icon`; - for (let i = 0; i < extensions.length; i++) { - const fileUrl = charIconBaseUrl + extensions[i]; + for (let i = 0; i < charicon_extensions.length; i++) { + const fileUrl = charIconBaseUrl + charicon_extensions[i]; const exists = await fileExists(fileUrl); if (exists) { img.alt = charname; -- cgit