diff options
| author | David Skoland <davidskoland@gmail.com> | 2026-04-01 14:01:03 +0200 |
|---|---|---|
| committer | David Skoland <davidskoland@gmail.com> | 2026-04-01 14:01:03 +0200 |
| commit | 679f0d1b683c40dad541b476eec74f32bf5cdd0e (patch) | |
| tree | c4c8e5e9143ab6f256cd69979a4b71fca90d0be6 | |
| parent | db931bb13b99f7a058b178bc2460958b6356ca46 (diff) | |
fix char select bug
| -rw-r--r-- | webAO/packets/handlers/handlePV.ts | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/webAO/packets/handlers/handlePV.ts b/webAO/packets/handlers/handlePV.ts index 13f2f00..3cf7dd5 100644 --- a/webAO/packets/handlers/handlePV.ts +++ b/webAO/packets/handlers/handlePV.ts @@ -4,6 +4,9 @@ import { updateActionCommands } from "../../dom/updateActionCommands"; import { pickEmotion } from "../../dom/pickEmotion"; import { AO_HOST } from "../../client/aoHost"; import { ensureCharIni } from "../../client/handleCharacterInfo"; +import { area_click } from "../../dom/areaClick"; + +let autoAreaDone = false; function addEmoteButton(i: number, imgurl: string, desc: string) { const emotesList = document.getElementById("client_emo"); @@ -103,13 +106,16 @@ export const handlePV = async (args: string[]) => { document.getElementById("button_4")!.style.display = "none"; } - if (autoArea) { + if (autoArea && !autoAreaDone) { + autoAreaDone = true; const areaIndex = client.areas.findIndex( (a: any) => a && a.name.toLowerCase() === autoArea.toLowerCase() ); if (areaIndex !== -1) { - client.sender.sendMusicChange(client.areas[areaIndex].name); - client.area = areaIndex; + const el = document.getElementById(`area${areaIndex}`); + if (el) { + area_click(el as HTMLElement); + } } } }; |
