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 },