Initial data model update

This commit is contained in:
WBHarry 2026-07-18 00:11:48 +02:00
parent 3828337472
commit 578e6e6c76
4 changed files with 43 additions and 25 deletions

View file

@ -469,6 +469,22 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
return acc;
}, {});
}
if (source.damage && source.damage.resources === undefined) {
source.damage.resources = {};
for (const [partKey, part] of Object.entries(source.damage.parts)) {
if (partKey === 'hitPoints') {
source.damage.main = {
...part,
includeBase: source.damage.includeBase,
direct: source.damage.direct,
groupAttack: source.damage.groupAttack
};
} else {
source.damage.resources[partKey] = part;
}
}
}
}
}