Skip to content

Commit

Permalink
Counting default form in caughtAttr for mons that don't have alternat…
Browse files Browse the repository at this point in the history
…ive forms
  • Loading branch information
Wlowscha committed Feb 14, 2025
1 parent f68a833 commit 8f498f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/data/pokemon-species.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1053,9 +1053,9 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali
}

// Summing successive bigints for each obtainable form
caughtAttr += this.forms
.map((f, index) => f.isUnobtainable ? 0n : 128n * 2n ** BigInt(index))
.reduce((acc, val) => acc + val, 0n);
caughtAttr += this?.forms?.length > 1 ?
this.forms.map((f, index) => f.isUnobtainable ? 0n : 128n * 2n ** BigInt(index)).reduce((acc, val) => acc + val, 0n) :
DexAttr.DEFAULT_FORM;

return caughtAttr;
}
Expand Down

0 comments on commit 8f498f1

Please sign in to comment.