Skip to content

Commit

Permalink
Roll item macros for linked actors even if another actor is selected (f…
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosFdez authored Dec 15, 2024
1 parent 47c25d1 commit 000549c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/module/apps/hotbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ class HotbarPF2e extends Hotbar<MacroPF2e> {
* @param slot The hotbar slot to use
*/
static async #createItemMacro(item: ItemPF2e, slot: number): Promise<void> {
const command = `game.pf2e.rollItemMacro("${item.id}", event);`;
const isLinked = !!item.actor?.prototypeToken.actorLink;
const command = `game.pf2e.rollItemMacro("${isLinked ? item.uuid : item.id}", event);`;
const macro =
game.macros.find((m) => m.name === item.name && m.command === command) ??
(await MacroPF2e.create(
Expand Down

0 comments on commit 000549c

Please sign in to comment.