From 2b9c3cb29103f1b3de8ca7ac0a8893865a713e0f Mon Sep 17 00:00:00 2001 From: Jonas Karlsson Date: Thu, 31 Oct 2024 21:18:24 +0100 Subject: [PATCH] fix: Don't autoroll damage due to a damage-taken message... --- src/module/hooks.ts | 6 +++++- submodules/my-foundryvtt-macros | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/module/hooks.ts b/src/module/hooks.ts index 63d20d7f2..d39630d44 100644 --- a/src/module/hooks.ts +++ b/src/module/hooks.ts @@ -95,7 +95,11 @@ export function createChatMessageHook(message: ChatMessagePF2e) { reminderTargeting(message, reminderTargetingSetting); } - if (!isActuallyDamageRoll(message)) { + function isDamageTaken(message: ChatMessagePF2e) { + return message.flags?.pf2e?.context?.type === "damage-taken"; + } + + if (!isActuallyDamageRoll(message) && !isDamageTaken(message)) { if ( game.settings.get(MODULENAME, "autoRollDamageAllow") && (game.settings.get(MODULENAME, "autoRollDamageForStrike") || diff --git a/submodules/my-foundryvtt-macros b/submodules/my-foundryvtt-macros index 524745518..94d6f21f2 160000 --- a/submodules/my-foundryvtt-macros +++ b/submodules/my-foundryvtt-macros @@ -1 +1 @@ -Subproject commit 524745518ebb57865ef30d0f0e885ddaedc058bf +Subproject commit 94d6f21f20a16713691534a9095e7aaf90a2663f