Skip to content

Commit

Permalink
Fix - auras/light range should be divided by grid units on scene not …
Browse files Browse the repository at this point in the history
…always 5.
  • Loading branch information
Azmoria committed Oct 8, 2023
1 parent c1d3c8d commit c4aed40
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Token.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c4aed40

Please sign in to comment.