From 0be49cffaa74e0c42511bd283a69d5bc320caa54 Mon Sep 17 00:00:00 2001 From: cadowtin Date: Mon, 28 Oct 2024 02:17:57 -0500 Subject: [PATCH] Fix up waiting for DiceSonNice --- scripts/helpers/misc.js | 1 + scripts/module.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/helpers/misc.js b/scripts/helpers/misc.js index 3bcbc1c..c3bce74 100644 --- a/scripts/helpers/misc.js +++ b/scripts/helpers/misc.js @@ -22,6 +22,7 @@ export function doSomethingOnDamageApply() { } export async function handleDiceSoNice(msg = null) { + if (msg === null) return false; return game.dice3d.waitFor3DAnimationByMessageID(message?.id); } diff --git a/scripts/module.js b/scripts/module.js index 41bc858..064c1b1 100644 --- a/scripts/module.js +++ b/scripts/module.js @@ -31,7 +31,7 @@ Hooks.on("ready", () => { Hooks.on("preDeleteCombat", preDeleteCombat); // You died Elden Ring Hooks.on("applyTokenStatusEffect", applyTokenStatusEffect); - Hooks.on("createChatMessage", async function (msg, _status, userid) { + Hooks.on("preCreateChatMessage", async function (msg, _status, userid) { if (game.user.id === userid) { if (!getSetting("enabled")) return; debugLog({