Skip to content

Commit 2565985

Browse files
committed
Use actor.getActiveTokens to locate tokens for the active effect
1 parent dcefeba commit 2565985

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

scripts/tokens.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,8 @@ export function cloneToken(wrapper) {
301301
export function createOrRemoveActiveEffectHook(effect, _opts, _userId) {
302302
if ( !effect.statuses.has(CONFIG.GeometryLib.proneStatusId) ) return;
303303

304-
const actorId = effect.parent?.id;
305-
if ( !actorId ) return;
304+
const tokens = effect.parent?.getActiveTokens();
305+
if ( !tokens) return;
306306

307-
canvas.tokens.placeables
308-
.filter(t => t.actor?.id === actorId)
309-
.forEach(t => t.vision._updateEVShadowData({changedElevation: true}));
307+
tokens.forEach(t => t.vision._updateEVShadowData({changedElevation: true}));
310308
}

0 commit comments

Comments
 (0)