From 6223b05eb17bd5d7e8cc1b40850c5b406fbf98f6 Mon Sep 17 00:00:00 2001 From: Dapoolp Date: Sun, 22 Jun 2025 23:06:59 +0200 Subject: [PATCH] Fix d20RollDialog costs check --- module/dialogs/d20RollDialog.mjs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/module/dialogs/d20RollDialog.mjs b/module/dialogs/d20RollDialog.mjs index af7c215a..814630cd 100644 --- a/module/dialogs/d20RollDialog.mjs +++ b/module/dialogs/d20RollDialog.mjs @@ -6,10 +6,9 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio this.config = config; this.config.experiences = []; - /* this.diceOptions = [ - { id:12, value: 'd12' }, - { id:20, value: 'd20' } - ]; */ + + this.item = config.actor.parent.items.get(config.source.item); + this.action = this.item.system.actions.find(a => a._id === config.source.action); } static DEFAULT_OPTIONS = { @@ -52,9 +51,9 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio /* context.diceOptions = this.diceOptions; */ context.canRoll = true; if(this.config.costs?.length) { - const updatedCosts = this.config.action.calcCosts(this.config.costs); + const updatedCosts = this.action.calcCosts(this.config.costs); context.costs = updatedCosts - context.canRoll = this.config.action.getRealCosts(updatedCosts)?.hasCost; + context.canRoll = this.action.getRealCosts(updatedCosts)?.hasCost; } return context; }