v11 Fix choix particulière #746

Merged
uberwald merged 2 commits from VincentVk/foundryvtt-reve-de-dragon:v11 into v11 2025-02-06 10:42:26 +01:00
Showing only changes of commit 78e30b5503 - Show all commits

View File

@ -19,10 +19,12 @@ export class RdDItemRace extends RdDItem {
return false return false
} }
} }
const carac = RdDCarac.carac(code) if (code == LIST_CARAC_PERSONNAGE.taille.code) {
if (race.isMax(actor, code, value - 1)) { const carac = RdDCarac.carac(code)
ui.notifications.warn(`${value} est supérieure au maximum de ${carac.label}`) if (race.isMax(actor, code, value - 1)) {
return false ui.notifications.warn(`${value} est supérieure au maximum de ${carac.label}`)
return false
}
} }
return true return true
} }
@ -59,7 +61,8 @@ export class RdDItemRace extends RdDItem {
if (code == LIST_CARAC_PERSONNAGE.force.code) { if (code == LIST_CARAC_PERSONNAGE.force.code) {
return value >= this.getForceMax(actor) 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) return (max > 0 && value >= max)
} }