Fixed combatant isNPC

This commit is contained in:
WBHarry 2025-12-06 15:55:55 +01:00
parent 07b494054e
commit b054d7b524
4 changed files with 9 additions and 1 deletions

View file

@ -261,7 +261,7 @@ export default class DhTooltipManager extends foundry.helpers.interaction.Toolti
async getBattlepointHTML(combatId) {
const combat = game.combats.get(combatId);
const adversaries =
combat.turns?.filter(x => x.isNPC)?.map(x => ({ ...x.actor, type: x.actor.system.type })) ?? [];
combat.turns?.filter(x => x.actor?.isNPC)?.map(x => ({ ...x.actor, type: x.actor.system.type })) ?? [];
const characters = combat.turns?.filter(x => !x.isNPC) ?? [];
const nrCharacters = characters.length;