diff --git a/module/rdd-carac.js b/module/rdd-carac.js index e97c83ea..725a6e93 100644 --- a/module/rdd-carac.js +++ b/module/rdd-carac.js @@ -95,7 +95,7 @@ export class RdDCarac { * ainsi que de Perception active et volontaire. */ static isActionPhysique(selectedCarac) { - return Grammar.toLowerCaseNoAccent(selectedCarac?.label).match(/(apparence|force|agilite|dexterite|vue|ouie|odorat|empathie|melee|tir|lancer|derobee)/); + return Grammar.toLowerCaseNoAccent(selectedCarac?.label)?.match(/(apparence|force|agilite|dexterite|vue|ouie|odorat|empathie|melee|tir|lancer|derobee)/); } /* -------------------------------------------- */ diff --git a/module/rolldata-ajustements.js b/module/rolldata-ajustements.js index 1164a345..5a638e38 100644 --- a/module/rolldata-ajustements.js +++ b/module/rolldata-ajustements.js @@ -55,7 +55,7 @@ export const referenceAjustements = { getValue: (rollData, actor) => actor.getEtatGeneral() }, malusArmure: { - isVisible: (rollData, actor) => RdDCarac.isAgiliteOuDerivee(rollData.competence), + isVisible: (rollData, actor) => RdDCarac.isAgiliteOuDerivee(rollData.selectedCarac), isUsed: (rollData, actor) => RdDCarac.isAgiliteOuDerivee(rollData.selectedCarac), getLabel: (rollData, actor) => 'Malus armure', getValue: (rollData, actor) => actor.getMalusArmure() @@ -131,6 +131,7 @@ export class RollDataAjustements { for (var key in referenceAjustements) { const reference = referenceAjustements[key]; rollData.ajustements[key] = { + visible: reference.isVisible && reference.isVisible(rollData, actor), used: reference.isUsed(rollData, actor), label: reference.getLabel && reference.getLabel(rollData, actor), value: reference.getValue && reference.getValue(rollData, actor),