From 78e30b5503c77cf608545a385ade73d8f2f03c97 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sun, 2 Feb 2025 00:05:53 +0100 Subject: [PATCH] Correction message min/max de race --- module/item/race.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/module/item/race.js b/module/item/race.js index e1685185..327ce850 100644 --- a/module/item/race.js +++ b/module/item/race.js @@ -19,10 +19,12 @@ export class RdDItemRace extends RdDItem { return false } } - const carac = RdDCarac.carac(code) - if (race.isMax(actor, code, value - 1)) { - ui.notifications.warn(`${value} est supérieure au maximum de ${carac.label}`) - return false + if (code == LIST_CARAC_PERSONNAGE.taille.code) { + const carac = RdDCarac.carac(code) + if (race.isMax(actor, code, value - 1)) { + ui.notifications.warn(`${value} est supérieure au maximum de ${carac.label}`) + return false + } } return true } @@ -59,7 +61,8 @@ export class RdDItemRace extends RdDItem { if (code == LIST_CARAC_PERSONNAGE.force.code) { return value >= this.getForceMax(actor) } - const max = foundry.utils.getProperty(this, path) ?? -1 + const pathMax = path.replace(".value", ".max"); + const max = foundry.utils.getProperty(this, pathMax) ?? -1 return (max > 0 && value >= max) }