diff --git a/src/module/flows/attack.ts b/src/module/flows/attack.ts index 9186317e..71d42572 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 = [];