mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Fix/929 flat modifier disappears (#936)
* Temp ActionField attack type missing * Move missing attack type to getModel
This commit is contained in:
parent
89e4e43026
commit
207d0d6335
2 changed files with 2 additions and 2 deletions
|
|
@ -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: "" })
|
||||
})
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue