Fix items not being rollable in the char sheet

This commit is contained in:
Johannes Loher 2021-07-23 17:08:07 +02:00
parent cada51877d
commit 710659510e
2 changed files with 2 additions and 2 deletions

View file

@ -309,7 +309,7 @@ export class DS4ActorSheet extends ActorSheet<ActorSheet.Options, DS4ActorSheetD
*/ */
protected onRollItem(event: JQuery.ClickEvent): void { protected onRollItem(event: JQuery.ClickEvent): void {
event.preventDefault(); event.preventDefault();
const id = $(event.currentTarget).parents(".item").data("itemId"); const id = $(event.currentTarget).parents(".item").data("id");
const item = this.actor.items.get(id); const item = this.actor.items.get(id);
enforce(item, getGame().i18n.format("DS4.ErrorActorDoesNotHaveItem", { id, actor: this.actor.name })); enforce(item, getGame().i18n.format("DS4.ErrorActorDoesNotHaveItem", { id, actor: this.actor.name }));
item.roll().catch((e) => notifications.error(e, { log: true })); item.roll().catch((e) => notifications.error(e, { log: true }));

View file

@ -38,7 +38,7 @@ async function getOrCreateRollItemMacro(itemData: foundry.data.ItemData["_source
} }
/** /**
* Executes the roll item macro for the given itemId. * Executes the roll item macro for the item associated to the given `itemId`.
*/ */
export async function rollItem(itemId: string): Promise<void> { export async function rollItem(itemId: string): Promise<void> {
const actor = getActiveActor(); const actor = getActiveActor();