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
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (code == LIST_CARAC_PERSONNAGE.taille.code) {
|
||||||
const carac = RdDCarac.carac(code)
|
const carac = RdDCarac.carac(code)
|
||||||
if (race.isMax(actor, code, value - 1)) {
|
if (race.isMax(actor, code, value - 1)) {
|
||||||
ui.notifications.warn(`${value} est supérieure au maximum de ${carac.label}`)
|
ui.notifications.warn(`${value} est supérieure au maximum de ${carac.label}`)
|
||||||
return false
|
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user