Fix d20RollDialog costs check

This commit is contained in:
Dapoolp 2025-06-22 23:06:59 +02:00
parent 22fa89b395
commit 6223b05eb1

View file

@ -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;
}