Simplify handling of optional values in a couple of places

This commit is contained in:
Johannes Loher 2021-02-18 13:36:36 +01:00
parent 24d8926645
commit b2490a2e2f
2 changed files with 5 additions and 7 deletions

View file

@ -26,9 +26,9 @@ export class DS4Item extends Item<DS4ItemData> {
/**
* The number of times that active effect changes originating from this item should be applied.
*/
get activeEffectFactor(): number {
get activeEffectFactor(): number | undefined {
if (this.data.type === "talent") {
return this.data.data.rank.total ?? this.data.data.rank.base + this.data.data.rank.mod;
return this.data.data.rank.total;
}
return 1;
}