From 07ba1c889b72f9ac9949cae6437584a4b78c6e63 Mon Sep 17 00:00:00 2001 From: macniel Date: Fri, 28 Nov 2025 14:59:42 +0100 Subject: [PATCH] fixes error found with ATTRIBUTO --- src/module/dialog/spellDialog.mjs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/module/dialog/spellDialog.mjs b/src/module/dialog/spellDialog.mjs index efc1fa02..f4ac417d 100644 --- a/src/module/dialog/spellDialog.mjs +++ b/src/module/dialog/spellDialog.mjs @@ -182,16 +182,19 @@ export class SpellDialog extends HandlebarsApplicationMixin(ApplicationV2) { } normalizeCastingCost() { - let costFormula = this._costModel.additionalFormula + if (costFormula) { - this._costModel.variables.forEach(v => { + this._costModel.variables.forEach(v => { - costFormula = costFormula.replace(v, this._costMutators[v]) + costFormula = costFormula.replace(v, this._costMutators[v]) - }) + }) - costFormula = Number(eval(costFormula)) + Number(this._costModel.cost) + costFormula = Number(eval(costFormula)) + Number(this._costModel.cost) + } else { + costFormula = this._costModel.cost + } if (costFormula <= this._costModel.min) { costFormula = this._costModel.min }