forked from public/foundryvtt-reve-de-dragon
Utilisation nullish / chaining
Simplifie certaines expressions complexes avec operateur ternaire - Nullish coalescing operator (??) - Relationship with the optional chaining operator (?.) - Math.min / Math.max / Math.ceil
This commit is contained in:
@ -66,11 +66,11 @@ export class RdDBonus {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static _dmgArme(rollData) {
|
||||
return rollData.arme ? parseInt(rollData.arme.data.dommages) : 0;
|
||||
return parseInt(rollData.arme?.data.dommages ?? 0);
|
||||
}
|
||||
|
||||
static _peneration(rollData) {
|
||||
return rollData.arme ? parseInt(rollData.arme.data.penetration) : 0;
|
||||
return parseInt(rollData.arme?.data.penetration ?? 0);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
Reference in New Issue
Block a user