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

Zero Enemy Data at end of battles #4867

Merged
merged 2 commits into from
Jun 26, 2024

Conversation

ghoulslash
Copy link
Collaborator

Enemy data is cleared at the start of trainer battles and with setwildbattle, but with #4688 there is a potential to use createmon to set up a complex wild battle without zeroing out said data beforehand, so stray pokemon data from previous battles could leak into such battles and cause problems. This PR just resets enemy mon data after each battle to prevent this from occurring.

It also adds a gBattleStruct != NULL check to the same block so FreeBattleResources and co. are only called once instead of over many frames while gPaletteFade is active

@AlexOn1ine AlexOn1ine merged commit 4158367 into rh-hideout:upcoming Jun 26, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants