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({