Fix a bug where the actor context was not being correctly called unless the user had an actor assigned to them

This commit is contained in:
Oliver 2026-05-02 18:56:23 -06:00
parent 5b59956016
commit 74d881c3df
2 changed files with 15 additions and 1 deletions

View file

@ -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
};