From c2cdc4201dfb8e4f7caa1efa665445e2d490d03f Mon Sep 17 00:00:00 2001 From: ZigmundKreud <63199460+ZigmundKreud@users.noreply.github.com> Date: Fri, 24 Dec 2021 17:23:43 +0100 Subject: [PATCH] =?UTF-8?q?FIX=20prise=20en=20compte=20du=20niveau=20de=20?= =?UTF-8?q?carri=C3=A8re=20dans=20les=20jets=20FIX=20erreur=20quand=20le?= =?UTF-8?q?=20personnage=20n'a=20pas=20de=20carri=C3=A8re?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/controllers/bol-rolls.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/module/controllers/bol-rolls.js b/module/controllers/bol-rolls.js index ea10d0d..c640a9b 100644 --- a/module/controllers/bol-rolls.js +++ b/module/controllers/bol-rolls.js @@ -38,6 +38,7 @@ export class BoLRoll { boons:actorData.features.boons, flaws:actorData.features.flaws }; + console.log(dialogData.careers); const rollOptionContent = await renderTemplate(rollOptionTpl, dialogData); let d = new Dialog({ title: label, @@ -56,8 +57,8 @@ export class BoLRoll { const attr = html.find('#attr').val(); const adv = html.find('#adv').val(); const mod = html.find('#mod').val(); - const careers = html.find('#career').val(); - const career = (careers.size >0) ? Math.max(...html.find('#career').val().map(i => parseInt(i))) : 0; + let careers = html.find('#career').val(); + const career = (!careers) ? 0 : Math.max(...careers.map(i => parseInt(i))); const isMalus = adv < 0; const dicePool = (isMalus) ? 2 - parseInt(adv) : 2 + parseInt(adv); const attrValue = eval(`actor.data.data.attributes.${attr}.value`); @@ -102,8 +103,8 @@ export class BoLRoll { const apt = html.find('#apt').val(); const adv = html.find('#adv').val(); const mod = html.find('#mod').val(); - const careers = html.find('#career').val(); - const career = (careers.size >0) ? Math.max(...html.find('#career').val().map(i => parseInt(i))) : 0; + let careers = html.find('#career').val(); + const career = (!careers) ? 0 : Math.max(...careers.map(i => parseInt(i))); const isMalus = adv < 0; const dicePool = (isMalus) ? 2 - parseInt(adv) : 2 + parseInt(adv); const aptValue = eval(`actor.data.data.aptitudes.${apt}.value`);