Skip to content

Commit

Permalink
Update logic.js
Browse files Browse the repository at this point in the history
Fix #62
Also improves #65
  • Loading branch information
mclemente committed Dec 16, 2022
1 parent a08d9f4 commit 29131cc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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 = {};
Expand Down

0 comments on commit 29131cc

Please sign in to comment.