From 710659510e4e66d8a5069260b5e9a3ff79a05a7a Mon Sep 17 00:00:00 2001
From: Johannes Loher <johannes.loher@fg4f.de>
Date: Fri, 23 Jul 2021 17:08:07 +0200
Subject: [PATCH] Fix items not being rollable in the char sheet

---
 src/module/actor/sheets/actor-sheet.ts | 2 +-
 src/module/macros/roll-item.ts         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/module/actor/sheets/actor-sheet.ts b/src/module/actor/sheets/actor-sheet.ts
index c11ec973..3dbd267a 100644
--- a/src/module/actor/sheets/actor-sheet.ts
+++ b/src/module/actor/sheets/actor-sheet.ts
@@ -309,7 +309,7 @@ export class DS4ActorSheet extends ActorSheet<ActorSheet.Options, DS4ActorSheetD
      */
     protected onRollItem(event: JQuery.ClickEvent): void {
         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);
         enforce(item, getGame().i18n.format("DS4.ErrorActorDoesNotHaveItem", { id, actor: this.actor.name }));
         item.roll().catch((e) => notifications.error(e, { log: true }));
diff --git a/src/module/macros/roll-item.ts b/src/module/macros/roll-item.ts
index 751a7e99..92c59b59 100644
--- a/src/module/macros/roll-item.ts
+++ b/src/module/macros/roll-item.ts
@@ -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> {
     const actor = getActiveActor();