aboutsummaryrefslogtreecommitdiff
path: root/webAO
diff options
context:
space:
mode:
authorDavid Skoland <davidskoland@gmail.com>2026-04-01 14:22:29 +0200
committerDavid Skoland <davidskoland@gmail.com>2026-04-01 14:22:29 +0200
commitd24cdeff690017969cebdee08e91db89848fd7ed (patch)
tree5e62794fb06889de0e43957cb40f1e759a96c16c /webAO
parent1d96e313911bcd8705392e8c75cd2275c604225f (diff)
fix only area bug
Diffstat (limited to 'webAO')
-rw-r--r--webAO/packets/handlers/handleDONE.ts15
-rw-r--r--webAO/packets/handlers/handlePV.ts17
2 files changed, 15 insertions, 17 deletions
diff --git a/webAO/packets/handlers/handleDONE.ts b/webAO/packets/handlers/handleDONE.ts
index c4e2454..947e2a1 100644
--- a/webAO/packets/handlers/handleDONE.ts
+++ b/webAO/packets/handlers/handleDONE.ts
@@ -1,5 +1,6 @@
import queryParser from "../../utils/queryParser";
-import { client, clientState, autoChar } from "../../client";
+import { client, clientState, autoChar, autoArea } from "../../client";
+import { area_click } from "../../dom/areaClick";
const { mode } = queryParser();
/**
@@ -17,6 +18,18 @@ export const handleDONE = (_args: string[]) => {
document.getElementById("client_waiting")!.style.display = "none";
}
+ if (autoArea) {
+ const areaIndex = client.areas.findIndex(
+ (a: any) => a && a.name.toLowerCase() === autoArea.toLowerCase()
+ );
+ if (areaIndex !== -1) {
+ const el = document.getElementById(`area${areaIndex}`);
+ if (el) {
+ area_click(el as HTMLElement);
+ }
+ }
+ }
+
if (autoChar) {
// Hide charselect immediately (spectator mode) so the user isn't stuck
// on the selection screen. If the CC request succeeds, PV will confirm it.
diff --git a/webAO/packets/handlers/handlePV.ts b/webAO/packets/handlers/handlePV.ts
index 3cf7dd5..90e47f1 100644
--- a/webAO/packets/handlers/handlePV.ts
+++ b/webAO/packets/handlers/handlePV.ts
@@ -1,12 +1,9 @@
-import { client, autoArea } from "../../client";
+import { client } from "../../client";
import fileExists from "../../utils/fileExists";
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");
@@ -106,16 +103,4 @@ export const handlePV = async (args: string[]) => {
document.getElementById("button_4")!.style.display = "none";
}
- if (autoArea && !autoAreaDone) {
- autoAreaDone = true;
- const areaIndex = client.areas.findIndex(
- (a: any) => a && a.name.toLowerCase() === autoArea.toLowerCase()
- );
- if (areaIndex !== -1) {
- const el = document.getElementById(`area${areaIndex}`);
- if (el) {
- area_click(el as HTMLElement);
- }
- }
- }
};