From 167c5bf6cc751022bae94b21b8a5c7f1ef36bcd9 Mon Sep 17 00:00:00 2001 From: Avery <74130268+velara@users.noreply.github.com> Date: Mon, 12 Jun 2023 13:36:12 -0600 Subject: [PATCH] Update main.js Incorporated changes from #49 Courtesy of Ironmonk. --- js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index 5fd837a..e25cd39 100644 --- a/js/main.js +++ b/js/main.js @@ -109,7 +109,7 @@ Hooks.once("enhancedTerrainLayer.ready", (RuleProvider) => { let obstacles = []; let costs = []; for(var ii = 0; ii= tokenElevation && (terrain[ii].object.document.elevation-(terrain[ii].object.document.depth ?? 0)) <= tokenElevation && (token?.actor?.alliance ?? "none" !== (terrain[ii].object?.actor?.alliance ?? 0))){ + if(terrain[ii].object.document.top >= tokenElevation && terrain[ii].object.document.bottom <= tokenElevation && (token?.actor?.alliance ?? "none" !== (terrain[ii].object?.actor?.alliance ?? 0))){ environments.push(terrain[ii].environment) obstacles.push(terrain[ii].obstacle) costs.push(terrain[ii].cost)