Fix/1144 fix experiences roll use costs (#1150)

* Temp ActionField attack type missing

* Move missing attack type to getModel

* Fix costs object being updated during getRealCosts
This commit is contained in:
Dapoulp 2025-09-05 02:45:05 +02:00 committed by GitHub
parent 3c893df175
commit f04619f73b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -94,7 +94,8 @@ export default class CostField extends fields.ArrayField {
} }
static getRealCosts(costs) { static getRealCosts(costs) {
const realCosts = costs?.length ? costs.filter(c => c.enabled) : []; const cloneCosts = foundry.utils.deepClone(costs),
realCosts = cloneCosts?.length ? cloneCosts.filter(c => c.enabled) : [];
let mergedCosts = []; let mergedCosts = [];
realCosts.forEach(c => { realCosts.forEach(c => {
const getCost = Object.values(mergedCosts).find(gc => gc.key === c.key); const getCost = Object.values(mergedCosts).find(gc => gc.key === c.key);