From 8de957b59b37585565a5f0d250320109dabb035f Mon Sep 17 00:00:00 2001 From: Branden J Brown Date: Wed, 26 Aug 2026 18:57:31 -0400 Subject: [PATCH] zenno: allow both stats in threshold modifier to be null --- zenno/src/lib/race.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/zenno/src/lib/race.ts b/zenno/src/lib/race.ts index e64b4e3..0c67707 100644 --- a/zenno/src/lib/race.ts +++ b/zenno/src/lib/race.ts @@ -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) { return 0.5 * (thresholdMod(stat1) + thresholdMod(stat2)); }