Merged with main

This commit is contained in:
WBHarry 2025-08-14 00:51:43 +02:00
commit ecd33caa7b
2 changed files with 3 additions and 10 deletions

View file

@ -82,10 +82,7 @@ export class ActionsField extends MappingField {
*/
export class ActionField extends foundry.data.fields.ObjectField {
getModel(value) {
return (
game.system.api.models.actions.actionsTypes[value.type] ??
null
);
return game.system.api.models.actions.actionsTypes[value.type] ?? null;
}
/* -------------------------------------------- */
@ -102,6 +99,7 @@ export class ActionField extends foundry.data.fields.ObjectField {
/** @override */
initialize(value, model, options = {}) {
if (value && !value.type) value.type = 'attack';
const cls = this.getModel(value);
if (cls) return new cls(value, { parent: model, ...options });
return foundry.utils.deepClone(value);