From dc259bc98790ce615aeece4662154e99b99a1772 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnier Date: Sat, 11 Jul 2026 00:22:49 +0200 Subject: [PATCH] fix: ReferenceError success is not defined dans boutons sousTension/oppose --- fvtt-hamalron.mjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fvtt-hamalron.mjs b/fvtt-hamalron.mjs index 0e8276e..17f1fd4 100644 --- a/fvtt-hamalron.mjs +++ b/fvtt-hamalron.mjs @@ -325,11 +325,12 @@ $(document).on("click", "[data-action='sousTension']", async function () { deckManager.addToDiscard(card) await deckManager.saveDeckState() + const successA = totalJoueur >= valeurMJ const content = await foundry.applications.handlebars.renderTemplate( "systems/fvtt-hamalron/templates/chat-tension.hbs", { cssClass: "fvtt-hamalron tension-roll", icon: "fa-bolt", label: game.i18n.localize("HAMALRON.Label.sousTension"), joueurName: actorName, joueurScore: totalJoueur, mjCard: `${card.name} (${valeurMJ})`, mjScore: valeurMJ, - isSuccess: success, isMJ: totalJoueur < valeurMJ, isSousTension: true }) + isSuccess: successA, isMJ: totalJoueur < valeurMJ, isSousTension: true }) ChatMessage.create({ content, style: CONST.CHAT_MESSAGE_STYLES.OTHER }) }) @@ -354,12 +355,12 @@ $(document).on("click", "[data-action='oppose']", async function () { deckManager.addToDiscard(card) await deckManager.saveDeckState() - const success = totalJoueur >= valeurOpposant + const successB = totalJoueur >= valeurOpposant const content = await foundry.applications.handlebars.renderTemplate( "systems/fvtt-hamalron/templates/chat-tension.hbs", { cssClass: "fvtt-hamalron tension-roll", icon: "fa-shield-halved", label: game.i18n.localize("HAMALRON.Label.oppose"), joueurName: actorName, joueurScore: totalJoueur, mjCard: `${card.name} (${valeurOpposant})`, mjScore: valeurOpposant, - isSuccess: success, isMJ: totalJoueur < valeurOpposant, isSousTension: false }) + isSuccess: successB, isMJ: totalJoueur < valeurOpposant, isSousTension: false }) ChatMessage.create({ content, style: CONST.CHAT_MESSAGE_STYLES.OTHER }) })