diff --git a/src/module/active-effect.ts b/src/module/active-effect.ts index 8a029c4..965f9f8 100644 --- a/src/module/active-effect.ts +++ b/src/module/active-effect.ts @@ -95,14 +95,11 @@ export class DS4ActiveEffect extends ActiveEffect { * @param context The context for the creation of the effect, requiring a parent {@link DS4Actor} or {@link DS4Item}. * @returns A promise that resolved to the created effect or udifined of the creation was prevented. */ - static async createDefault( - context: DocumentModificationContext & { parent: DS4Actor | DS4Item }, - ): Promise { + static async createDefault(parent: DS4Actor | DS4Item): Promise { const createData = { label: getGame().i18n.localize(`DS4.NewEffectLabel`), icon: this.FALLBACK_ICON, }; - - return this.create(createData, context); + return parent.createEmbeddedDocuments("ActiveEffect", [createData]) as Promise; } } diff --git a/src/module/actor/sheets/actor-sheet.ts b/src/module/actor/sheets/actor-sheet.ts index e192e49..58651f4 100644 --- a/src/module/actor/sheets/actor-sheet.ts +++ b/src/module/actor/sheets/actor-sheet.ts @@ -141,7 +141,7 @@ export class DS4ActorSheet extends ActorSheet * Create a new ActiveEffect for the item using default data. */ protected createActiveEffect(): void { - DS4ActiveEffect.createDefault({ parent: this.item }); + DS4ActiveEffect.createDefault(this.item); } }