[Bug][UI/UX] Fix bug in Pokédex for Mothim and other niche cases #5458
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why am I making these changes?
Discord bug report is here
This is a bit convoluted. The game keeps track of caught forms for every caught species. For species that have no forms, it still marks the "default form" as caught. Now, it turns out that if you evolve a Sand Cloak or Trash Cloak Burmy into Mothim, the "default form" on Mothim is not marked as uncaught, probably because the game tries to unlock form 1 and 2, respectively, instead. A similar thing happens with Milcery when catching an Alcremie form with formIndex > 0, and there might be other niche cases as well.
This normally has no impact whatsoever, because these mons do not actually have a form to use anywhere in the code. The Pokédex, however, was checking
DexAttr.DEFAULT_FORM
, causing Mothim and Milcery to be shown as uncaught unless they had been obtained in a specific way. This can be easily fixed in the dex and is probably minor enough not to warrant other code changes and a save migration (although we can do that later on if it turns out to be necessary).What are the changes from a developer perspective?
This PR is focused solely on ensuring consistent behavior in the dex. The
isFormCaught()
function now always returnstrue
if the species is caught and it only has a single form or no forms at all.Screenshots/Videos
Screenshots from a save where Mothim and Milcery both do not have



DexAttr.DEFAULT_FORM
(see that form 0 of Alcremie is not caught).How to test the changes?
A bit tricky, but one way is to start the game from a blank save file and catch Sand CLoak Burmy -> evolve it, or catch a random form of Alcremie, and checking that Mothim or Milcery are displayed correctly.
Checklist
beta
as my base branchnpm run test
)npm run create-test
) or updated existing tests related to the PR's changes?