[Bug][Hotfix] Show caught pokemon correctly #5320

Merge pull request #5320 from Wlowscha/hotfix-show-caught-pokemon-correctly
This commit is contained in:
damocleas 2025-02-13 21:25:09 -05:00 committed by GitHub
commit 727bf0d74d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "pokemon-rogue-battle",
"version": "1.6.1",
"version": "1.6.2",
"lockfileVersion": 3,
"requires": true,
"packages": {

View File

@ -1,7 +1,7 @@
{
"name": "pokemon-rogue-battle",
"private": true,
"version": "1.6.1",
"version": "1.6.2",
"type": "module",
"scripts": {
"start": "vite",

View File

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