[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", "name": "pokemon-rogue-battle",
"version": "1.6.1", "version": "1.6.2",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {

View File

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

View File

@ -1053,9 +1053,9 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali
} }
// Summing successive bigints for each obtainable form // Summing successive bigints for each obtainable form
caughtAttr += this.forms caughtAttr += this?.forms?.length > 1 ?
.map((f, index) => f.isUnobtainable ? 0n : 128n * 2n ** BigInt(index)) this.forms.map((f, index) => f.isUnobtainable ? 0n : 128n * 2n ** BigInt(index)).reduce((acc, val) => acc + val, 0n) :
.reduce((acc, val) => acc + val, 0n); DexAttr.DEFAULT_FORM;
return caughtAttr; return caughtAttr;
} }