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)); }