mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 19:51:08 +01:00
Fixed combatant isNPC
This commit is contained in:
parent
07b494054e
commit
b054d7b524
4 changed files with 9 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
export { default as DhpActor } from './actor.mjs';
|
||||
export { default as DHItem } from './item.mjs';
|
||||
export { default as DhpCombat } from './combat.mjs';
|
||||
export { default as DHCombatant } from './combatant.mjs';
|
||||
export { default as DhActiveEffect } from './activeEffect.mjs';
|
||||
export { default as DhChatMessage } from './chatMessage.mjs';
|
||||
export { default as DhToken } from './token.mjs';
|
||||
|
|
|
|||
6
module/documents/combatant.mjs
Normal file
6
module/documents/combatant.mjs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
export default class DhCombatant extends Combatant {
|
||||
/**@inheritdoc */
|
||||
get isNPC() {
|
||||
return this.actor?.isNPC ?? (!this.actor || !this.hasPlayerOwner);
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue