diff --git a/module/data/fields/action/damageField.mjs b/module/data/fields/action/damageField.mjs index 9e9e4b16..810b6e76 100644 --- a/module/data/fields/action/damageField.mjs +++ b/module/data/fields/action/damageField.mjs @@ -29,7 +29,7 @@ export class DHActionDiceData extends foundry.abstract.DataModel { bonus: new fields.NumberField({ nullable: true, initial: null, label: 'Bonus' }), custom: new fields.SchemaField({ enabled: new fields.BooleanField({ label: 'Custom Formula' }), - formula: new FormulaField({ label: 'Formula' }) + formula: new FormulaField({ label: 'Formula', initial: "" }) }) }; } diff --git a/module/data/fields/actionField.mjs b/module/data/fields/actionField.mjs index a8b01e37..4ae436de 100644 --- a/module/data/fields/actionField.mjs +++ b/module/data/fields/actionField.mjs @@ -82,6 +82,7 @@ export class ActionsField extends MappingField { */ export class ActionField extends foundry.data.fields.ObjectField { getModel(value) { + if(value && !value.type) value.type = 'attack'; return ( game.system.api.models.actions.actionsTypes[value.type] ?? null @@ -102,7 +103,6 @@ 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);