From 285b84f57f15922b16d2d0392bd7779e8ee27e6a Mon Sep 17 00:00:00 2001 From: Joe Nosie <182554+BoltsJ@users.noreply.github.com> Date: Sun, 1 Dec 2024 22:41:16 -0600 Subject: [PATCH] Fix consuming lockon Targeting data contained the uuid, but was being compared to the plain id, so the comparison was always false. Fixes: #801 --- src/module/flows/attack.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/module/flows/attack.ts b/src/module/flows/attack.ts index 9186317ef..71d425729 100644 --- a/src/module/flows/attack.ts +++ b/src/module/flows/attack.ts @@ -494,13 +494,14 @@ export async function printAttackCard( // If user is GM, apply status changes to attacked tokens Hooks.on("createChatMessage", async (cm: ChatMessage, options: any, id: string) => { - // Consume lock-on if we are a GM - if (!game.user?.isGM) return; + // Consume lock-on if we are the primary GM + // @ts-expect-error Types user collection missing activeGM + if (!game.users?.activeGM?.isSelf) return; const atkData: AttackFlag = cm.getFlag(game.system.id, "attackData") as any; if (!atkData || !atkData.targets) return; atkData.targets.forEach(target => { // Find the target in this scene - const tokenActor = game.canvas.scene?.tokens.find(token => token.id === target.id)?.actor; + const tokenActor = game.canvas.scene?.tokens.find(token => token.uuid === target.id)?.actor; if (!tokenActor) return; const statusToApply = []; const statusToRemove = [];