Correction message min/max de race
This commit is contained in:
parent
069fef4720
commit
78e30b5503
@ -19,11 +19,13 @@ export class RdDItemRace extends RdDItem {
|
||||
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)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user