zenno: allow both stats in threshold modifier to be null
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful

This commit is contained in:
2026-08-26 18:57:31 -04:00
parent 206fee797c
commit 8de957b59b
+7 -1
View File
@@ -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));
} }