[Fix] Support elevation in token distance hovering and fix error when overlapping (#1675)

* Support elevation in token distance hovering

* Reduce diffs

* Refine elevation check to handle stacked tokens

* Fix issue with overlapping tokens

* Fix tooltip reporting very close for adjacent diagonal tokens
This commit is contained in:
Carlos Fernandez 2026-02-26 05:37:40 -05:00 committed by GitHub
parent 1b09b44d6c
commit 4324c3abf2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 46 additions and 27 deletions

View file

@ -420,10 +420,7 @@ const updateActorsRangeDependentEffects = async token => {
// Get required distance and special case 5 feet to test adjacency
const required = rangeMeasurement[range];
const reverse = type === CONFIG.DH.GENERAL.rangeInclusion.outsideRange.id;
const inRange =
required === 5
? userTarget.isAdjacentWith(token.object)
: userTarget.distanceTo(token.object) <= required;
const inRange = userTarget.distanceTo(token.object) <= required;
if (reverse ? inRange : !inRange) {
enabledEffect = false;
break;