mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-09-08 20:08:38 -05:00
Fix teambuilder crash on illegal natures (#2597)
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user