From 1577435a337749541ccaae1714a500c30bcfed47 Mon Sep 17 00:00:00 2001 From: Jonathan Calvert <38069151+JDCalvert@users.noreply.github.com> Date: Fri, 6 May 2022 19:16:52 +0100 Subject: [PATCH] Fix issue caused by client setting moving from Levels to Wall Height (#195) --- js/pathfinding.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/pathfinding.js b/js/pathfinding.js index 8bedacb..cad2851 100644 --- a/js/pathfinding.js +++ b/js/pathfinding.js @@ -272,12 +272,12 @@ function buildTokenData(token) { // Almost all the information we need is for calculating the snap point const tokenData = buildSnapPointTokenData(token); - // If levels is enabled, which walls matter depends on the token's elevation. - // Depending on the settings in levels, the height we care about is either their - // Foot height (elevation) or eye height (losHeight). - if (isModuleActive("levels")) { - const blockSightMovement = game.settings.get(_levelsModuleName, "blockSightMovement"); - tokenData.elevation = blockSightMovement ? token.data.elevation : token.losHeight; + // If Wall Height is enabled, which walls matter depends on the token's elevation. + // Depending on the settings in Wall Height, the height we care about is either their + // foot height (elevation) or eye height (losHeight). + if (isModuleActive("wall-height")) { + const blockSightMovement = game.settings.get("wall-height", "blockSightMovement"); + tokenData.elevation = blockSightMovement ? token.losHeight : token.data.elevation; } return tokenData;