From 29131ccdd25d8cb225b5df5ed483d90759c6d13a Mon Sep 17 00:00:00 2001 From: Matheus Clemente Date: Fri, 16 Dec 2022 19:14:31 -0300 Subject: [PATCH] Update logic.js Fix https://github.com/mclemente/about-face/issues/62 Also improves https://github.com/mclemente/about-face/issues/65 --- scripts/logic.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/logic.js b/scripts/logic.js index d481b92..fdc901f 100644 --- a/scripts/logic.js +++ b/scripts/logic.js @@ -32,9 +32,6 @@ export function onPreCreateToken(document, data, options, userId) { if (canvas.scene.getFlag(MODULE_ID, "lockRotation")) { updates.lockRotation = true; } - if (document.rotation && document.flags?.[MODULE_ID]?.rotationOffset === undefined) { - updates.flags[MODULE_ID].rotationOffset = document.rotation; - } if (facingDirection) { const flipMode = game.settings.get(MODULE_ID, "flip-or-rotate"); const gridType = getGridType(); @@ -54,7 +51,11 @@ export function onPreCreateToken(document, data, options, userId) { } export function onPreUpdateToken(tokenDocument, updates, options, userId) { - if (!canvas.scene.getFlag(MODULE_ID, "sceneEnabled") || options?.mlt_bypass) return; + if (!canvas.scene.getFlag(MODULE_ID, "sceneEnabled")) return; + if (game.modules.get("multilevel-tokens")?.active) { + // Ignore animation if movement is from a MLT teleporter + if (!game.multilevel._isReplicatedToken(tokenDocument) && options?.mlt_bypass) return; + } const durations = []; let position = {};