From c4aed40e70223905f5eda1823fad74dcaf30020b Mon Sep 17 00:00:00 2001 From: Azmoria <65363489+Azmoria@users.noreply.github.com> Date: Sun, 8 Oct 2023 02:23:41 -0400 Subject: [PATCH] Fix - auras/light range should be divided by grid units on scene not always 5. --- Token.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Token.js b/Token.js index 44a299d3e..3fef0f00d 100644 --- a/Token.js +++ b/Token.js @@ -2835,8 +2835,8 @@ function token_health_aura(hpPercentage) { function setTokenAuras (token, options) { if (!options.aura1) return; - const innerAuraSize = options.aura1.feet.length > 0 ? (options.aura1.feet / 5) * window.CURRENT_SCENE_DATA.hpps/window.CURRENT_SCENE_DATA.scale_factor : 0; - const outerAuraSize = options.aura2.feet.length > 0 ? (options.aura2.feet / 5) * window.CURRENT_SCENE_DATA.hpps/window.CURRENT_SCENE_DATA.scale_factor : 0; + const innerAuraSize = options.aura1.feet.length > 0 ? (options.aura1.feet / parseInt(window.CURRENT_SCENE_DATA.fpsq)) * window.CURRENT_SCENE_DATA.hpps/window.CURRENT_SCENE_DATA.scale_factor : 0; + const outerAuraSize = options.aura2.feet.length > 0 ? (options.aura2.feet / parseInt(window.CURRENT_SCENE_DATA.fpsq)) * window.CURRENT_SCENE_DATA.hpps/window.CURRENT_SCENE_DATA.scale_factor : 0; if ((innerAuraSize > 0 || outerAuraSize > 0) && options.auraVisible) { // use sizeWidth and sizeHeight??? const totalAura = innerAuraSize + outerAuraSize; @@ -2881,9 +2881,9 @@ function setTokenAuras (token, options) { function setTokenLight (token, options) { if (!options.light1 || window.CURRENT_SCENE_DATA.disableSceneVision == true) return; - const innerlightSize = options.light1.feet.length > 0 ? (options.light1.feet / 5) * window.CURRENT_SCENE_DATA.hpps/window.CURRENT_SCENE_DATA.scale_factor : 0; - const outerlightSize = options.light2.feet.length > 0 ? (options.light2.feet / 5) * window.CURRENT_SCENE_DATA.hpps/window.CURRENT_SCENE_DATA.scale_factor : 0; - const visionSize = options.vision.feet.length > 0 ? (options.vision.feet / 5) * window.CURRENT_SCENE_DATA.hpps/window.CURRENT_SCENE_DATA.scale_factor : 0; + const innerlightSize = options.light1.feet.length > 0 ? (options.light1.feet / parseInt(window.CURRENT_SCENE_DATA.fpsq)) * window.CURRENT_SCENE_DATA.hpps/window.CURRENT_SCENE_DATA.scale_factor : 0; + const outerlightSize = options.light2.feet.length > 0 ? (options.light2.feet / parseInt(window.CURRENT_SCENE_DATA.fpsq)) * window.CURRENT_SCENE_DATA.hpps/window.CURRENT_SCENE_DATA.scale_factor : 0; + const visionSize = options.vision.feet.length > 0 ? (options.vision.feet / parseInt(window.CURRENT_SCENE_DATA.fpsq)) * window.CURRENT_SCENE_DATA.hpps/window.CURRENT_SCENE_DATA.scale_factor : 0; if (options.auraislight) { // use sizeWidth and sizeHeight??? const totallight = innerlightSize + outerlightSize;