From 4cf6e687039daa2923044455f3ba86af76579dbb Mon Sep 17 00:00:00 2001 From: Dennis Postma Date: Sun, 15 Sep 2024 02:01:36 +0200 Subject: [PATCH] #100 : When switching to zone manager, GM character isnt removed from zone it was in --- src/stores/zoneEditor.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/stores/zoneEditor.ts b/src/stores/zoneEditor.ts index e352d88..bb7b5fb 100644 --- a/src/stores/zoneEditor.ts +++ b/src/stores/zoneEditor.ts @@ -8,6 +8,8 @@ type TeleportSettings = { toPositionY: number } +const gameStore = useGameStore() + export const useZoneEditorStore = defineStore('zoneEditor', { state: () => ({ active: false, @@ -41,6 +43,7 @@ export const useZoneEditorStore = defineStore('zoneEditor', { }), actions: { toggleActive() { + if (!this.active) gameStore.connection?.emit('zone:character:leave') if (this.active) this.reset() this.active = !this.active },