diff --git a/scripts/patches.js b/scripts/patches.js index d753a8d..75790bd 100644 --- a/scripts/patches.js +++ b/scripts/patches.js @@ -225,6 +225,12 @@ class WallHeightUtils{ export function registerWrappers() { globalThis.WallHeight = new WallHeightUtils(); + Object.defineProperty(AmbientLightDocument.prototype, "elevation", { + get: function () { + return this.flags?.levels?.rangeBottom ?? canvas.primary.background.elevation; + } + }); + function tokenOnUpdate(wrapped, ...args) { wrapped(...args); diff --git a/scripts/utils.js b/scripts/utils.js index 10b0594..3a7f898 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -8,7 +8,7 @@ export function getTokenLOSheight(token) { token.document.flags[MODULE_SCOPE]?.tokenHeight || canvas.scene.dimensions.distance * Math.max(token.document.width, token.document.height) * - ((token.document.texture.scaleX + token.document.texture.scaleY) / 2); + ((Math.abs(token.document.texture.scaleX) + Math.abs(token.document.texture.scaleY)) / 2); } else { losDiff = token.document.flags[MODULE_SCOPE]?.tokenHeight || WallHeight._defaultTokenHeight; }