From fe346f46bf401e5eaec1a4af6717f5bd8b63d25e Mon Sep 17 00:00:00 2001 From: LeRatierBretonnier Date: Sat, 4 Jul 2026 09:22:38 +0200 Subject: [PATCH] fix: register _dice-breakdown.hbs partial, await ready hook promises MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mulligan reroll reaction message creation was failing silently because the chat/dice-breakdown Handlebars partial was never registered via loadTemplates. This caused an unhandled promise rejection that aborted the entire reroll handler chain — no mulligan message, no combat result. --- lethal-fantasy.mjs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lethal-fantasy.mjs b/lethal-fantasy.mjs index 446e6ba..6d2ba65 100644 --- a/lethal-fantasy.mjs +++ b/lethal-fantasy.mjs @@ -108,11 +108,16 @@ function preLocalizeConfig() { } } -Hooks.once("ready", function () { +Hooks.once("ready", async function () { console.info("LETHAL FANTASY | Ready") // Initialiser la table des résultats D30 - documents.D30Roll.initialize() + await documents.D30Roll.initialize() + + // Register Handlebars partials used by chat templates + await foundry.applications.handlebars.loadTemplates([ + "systems/fvtt-lethal-fantasy/templates/chat/_dice-breakdown.hbs" + ]) // Saignement piloté par le combat tracker _registerBleedingHooks()