Fix teambuilder crash on illegal natures (#2597)

This commit is contained in:
Slayer95
2026-03-15 01:29:41 -05:00
committed by GitHub
parent ce516b75ce
commit a0322536dd

View File

@@ -3189,7 +3189,7 @@ export function BattleStatOptimizer(set: Dex.PokemonSet, formatid: ID) {
return ~~(val);
};
const origNature = BattleNatures[set.nature || 'Serious'];
const origNature = BattleNatures[set.nature!] ?? BattleNatures['Serious'];
const origStats = {
// no need to calculate hp
atk: getStat('atk', set.evs.atk || 0, origNature),