From d9ca4736743aa9875b2793e7228e56bb2a0b996b Mon Sep 17 00:00:00 2001 From: James Lyne Date: Mon, 17 Jan 2022 16:45:42 +0000 Subject: [PATCH] Cancel existing follow when manually switching worlds --- src/store/mutations.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/store/mutations.ts b/src/store/mutations.ts index 9f8fc04..887257c 100644 --- a/src/store/mutations.ts +++ b/src/store/mutations.ts @@ -413,10 +413,15 @@ export const mutations: MutationTree & Mutations = { const newWorld = state.worlds.get(worldName); if(state.currentWorld !== newWorld) { - state.currentWorld = state.worlds.get(worldName); + state.currentWorld = newWorld; state.markerSets.clear(); state.pendingMarkerUpdates.splice(0); state.pendingTileUpdates.splice(0); + + // Cancel follow when switching to a different world + if(state.followTarget && state.followTarget.location.world !== newWorld!.name) { + state.followTarget = undefined; + } } state.currentMap = state.maps.get(mapName);