Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: getting ID of species.battleOnly when it's an array #10291

Open
andrebastosdias opened this issue May 11, 2024 · 0 comments
Open

Bug: getting ID of species.battleOnly when it's an array #10291

andrebastosdias opened this issue May 11, 2024 · 0 comments

Comments

@andrebastosdias
Copy link
Contributor

andrebastosdias commented May 11, 2024

} else if (species.battleOnly) {
species.tier = this.dex.data.FormatsData[toID(species.battleOnly)].tier || 'Illegal';
species.doublesTier = this.dex.data.FormatsData[toID(species.battleOnly)].doublesTier || 'Illegal';
species.natDexTier = this.dex.data.FormatsData[toID(species.battleOnly)].natDexTier || 'Illegal';

I created a mod where I set isNonstandard = "Past" for all Zygarde forms. However, I didn't manually set tier, doublesTier, and natDexTier to Illegal. When Zygarde-Complete attempts to derive the tiers from its base forms, it converts the array ["Zygarde", "Zygarde-10%"] into an ID. Consequently, it ends up trying to fetch the tier of an undefined element, causing a crash.

I'm unsure if this is the only part of the code affected, but it seems somewhat inefficient to have to set the tiers of all non-standard to Illegal just to avoid this bug (although this currently only impacts Zygarde-Complete and Necrozma-Ultra). Setting the tiers to Illegal avoids entering this part of the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant