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

Remove form change function footguns #5995

Conversation

AsparagusEduardo
Copy link

Description

Currently, when form changes are checked, the functions return SPECIES_NONE if they won't change form in the current conditions and this is checked on all their uses. However, should a user forget to check for SPECIES_NONE, their mon will essentially be deleted due to setting their species to SPECIES_NONE. This PR aims to fix this by changing the functions into returning the current species, along with updating their checks.

Already tested with item hold, weather and Gigantamax form changes, so I'd be safe to say that all of them work correctly. Feel free to test indepth if you desire.

People who collaborated with me in this PR

@AlexOn1ine for letting me know of this potential issue.

Things to note in the release changelog:

  • GetBattleFormChangeTargetSpecies, GetFormChangeTargetSpecies and GetFormChangeTargetSpeciesBoxMon now return the current species of the Pokémon instead of SPECIES_NONE as a precaution to avoid accidental deletions of Pokémon when using these functions.

Discord contact info

AsparagusEduardo

@AlexOn1ine AlexOn1ine self-assigned this Jan 10, 2025
@AlexOn1ine
Copy link
Collaborator

I think this is a good change overall. Avoid the mentioned potential footgun is useful for users.

@AlexOn1ine AlexOn1ine merged commit c33c38e into rh-hideout:upcoming Jan 11, 2025
1 check passed
@AsparagusEduardo AsparagusEduardo deleted the _RHH/pr/upcoming/formChangeFootGun branch January 11, 2025 10:44
@hedara90 hedara90 added the category: pokemon Pertains to Pokémon data and functionality label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: pokemon Pertains to Pokémon data and functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants