mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-05 20:34:15 +02:00
Fixed so that already destroyed companion tokens that foundry still lists are not considered (#1901)
This commit is contained in:
parent
98049bd76b
commit
d78c6b1183
1 changed files with 3 additions and 1 deletions
|
|
@ -124,7 +124,9 @@ export default class DHTokenHUD extends foundry.applications.hud.TokenHUD {
|
||||||
const animationDuration = 500;
|
const animationDuration = 500;
|
||||||
const scene = game.scenes.get(game.user.viewedScene);
|
const scene = game.scenes.get(game.user.viewedScene);
|
||||||
/* getDependentTokens returns already removed tokens with id = null. Need to filter that until it's potentially fixed from Foundry */
|
/* getDependentTokens returns already removed tokens with id = null. Need to filter that until it's potentially fixed from Foundry */
|
||||||
const activeTokens = actors.flatMap(member => member.getDependentTokens({ scenes: scene }).filter(x => x._id));
|
const activeTokens = actors.flatMap(member =>
|
||||||
|
member.getDependentTokens({ scenes: scene }).filter(x => x._id && !x._destroyed)
|
||||||
|
);
|
||||||
const { x: actorX, y: actorY } = this.document;
|
const { x: actorX, y: actorY } = this.document;
|
||||||
if (activeTokens.length > 0) {
|
if (activeTokens.length > 0) {
|
||||||
for (let token of activeTokens) {
|
for (let token of activeTokens) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue