Skip to content

Commit

Permalink
aa
Browse files Browse the repository at this point in the history
  • Loading branch information
theripper93 committed Sep 29, 2022
1 parent 399e917 commit f44f132
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions scripts/patches.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f44f132

Please sign in to comment.