diff --git a/module/data/Item/attribute.mjs b/module/data/Item/attribute.mjs index 6c83a9d..1bb65c1 100644 --- a/module/data/Item/attribute.mjs +++ b/module/data/Item/attribute.mjs @@ -162,7 +162,14 @@ export class AttributeItemData extends foundry.abstract.TypeDataModel { }); }; - await macro?.execute({ item: this.parent }); + // Get the speaker so that Foundry has the correct context to be able to call + // the Actor's getData method, letting us augment the context dynamically for + // the @active roll context + const speaker = foundry.documents.ChatMessage.implementation.getSpeaker({ + actor: this.parent.parent + }); + + await macro?.execute({ item: this.parent, speaker }); }; // #endregion Methods }; diff --git a/module/data/Item/generic.mjs b/module/data/Item/generic.mjs index 6552f19..5c0b8db 100644 --- a/module/data/Item/generic.mjs +++ b/module/data/Item/generic.mjs @@ -84,6 +84,13 @@ export class GenericItemData extends foundry.abstract.TypeDataModel { }); }; + // Get the speaker so that Foundry has the correct context to be able to call + // the Actor's getData method, letting us augment the context dynamically for + // the @active roll context + const speaker = foundry.documents.ChatMessage.implementation.getSpeaker({ + actor: this.parent.parent + }); + await macro?.execute({ item: this.parent }); }; // #endregion Methods