diff options
Diffstat (limited to 'webAO/packets/handlers/handlePV.ts')
| -rw-r--r-- | webAO/packets/handlers/handlePV.ts | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/webAO/packets/handlers/handlePV.ts b/webAO/packets/handlers/handlePV.ts index 1ee13c8..13f2f00 100644 --- a/webAO/packets/handlers/handlePV.ts +++ b/webAO/packets/handlers/handlePV.ts @@ -1,4 +1,4 @@ -import { client } from "../../client"; +import { client, autoArea } from "../../client"; import fileExists from "../../utils/fileExists"; import { updateActionCommands } from "../../dom/updateActionCommands"; import { pickEmotion } from "../../dom/pickEmotion"; @@ -102,4 +102,14 @@ export const handlePV = async (args: string[]) => { } else { document.getElementById("button_4")!.style.display = "none"; } + + if (autoArea) { + 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; + } + } }; |
