zenno: allow both stats in threshold modifier to be null
This commit is contained in:
@@ -275,7 +275,13 @@ export function adjustedStat(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function thresholdMod(stat1: number, stat2?: number): number {
|
export function thresholdMod(stat1: number | null | undefined, stat2?: number | null): number {
|
||||||
|
if (stat1 == null) {
|
||||||
|
if (stat2 == null) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return thresholdMod(stat2);
|
||||||
|
}
|
||||||
if (stat2 != null) {
|
if (stat2 != null) {
|
||||||
return 0.5 * (thresholdMod(stat1) + thresholdMod(stat2));
|
return 0.5 * (thresholdMod(stat1) + thresholdMod(stat2));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user