From 9ce66e93fbee04b8bbe647648e2090937b576c7c Mon Sep 17 00:00:00 2001 From: Dapoolp Date: Wed, 6 Aug 2025 18:48:10 +0200 Subject: [PATCH] #653 --- module/data/action/baseAction.mjs | 2 +- module/data/chat-message/adversaryRoll.mjs | 2 +- module/dice/d20Roll.mjs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/data/action/baseAction.mjs b/module/data/action/baseAction.mjs index 0ccaa8a5..8f04d1a0 100644 --- a/module/data/action/baseAction.mjs +++ b/module/data/action/baseAction.mjs @@ -111,7 +111,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel return actorData; } - async use(event, options) { + async use(event, options = {}) { if (!this.actor) throw new Error("An Action can't be used outside of an Actor context."); if (this.chatDisplay) await this.toChat(); diff --git a/module/data/chat-message/adversaryRoll.mjs b/module/data/chat-message/adversaryRoll.mjs index d6c8851c..c0c218e3 100644 --- a/module/data/chat-message/adversaryRoll.mjs +++ b/module/data/chat-message/adversaryRoll.mjs @@ -132,7 +132,7 @@ export default class DHActorRoll extends foundry.abstract.TypeDataModel { if(this.targetSelection === true) { this.targetShort = this.targets.reduce((a,c) => { if(c.hit) a.hit += 1; - else c.miss += 1; + else a.miss += 1; return a; }, {hit: 0, miss: 0}) } diff --git a/module/dice/d20Roll.mjs b/module/dice/d20Roll.mjs index b30bafbf..62dc0d7f 100644 --- a/module/dice/d20Roll.mjs +++ b/module/dice/d20Roll.mjs @@ -145,7 +145,7 @@ export default class D20Roll extends DHRoll { config.targetSelection = true; config.targets.forEach(target => { const difficulty = config.roll.difficulty ?? target.difficulty ?? target.evasion; - target.hit = this.isCritical || roll.total >= difficulty; + target.hit = roll.isCritical || roll.total >= difficulty; }); data.success = config.targets.some(target => target.hit) } else if (config.roll.difficulty) {