mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
Fix costs object being updated during getRealCosts
This commit is contained in:
parent
e3859c5fea
commit
fa7196d5d2
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue