Skip to content

Commit

Permalink
Zero Enemy Data at end of battles (#4867)
Browse files Browse the repository at this point in the history
* zero enemy data in FreeResetData_ReturnToOvOrDoEvolutions

* only run through FreeBattleResources once at end of battle in FreeResetData_ReturnToOvOrDoEvolutions

---------

Co-authored-by: ghoulslash <[email protected]>
  • Loading branch information
ghoulslash and ghoulslash committed Jun 26, 2024
1 parent 81bd148 commit 4158367
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/battle_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5526,8 +5526,9 @@ static void FreeResetData_ReturnToOvOrDoEvolutions(void)
}

FreeAllWindowBuffers();
if (!(gBattleTypeFlags & BATTLE_TYPE_LINK))
if (gBattleStruct != NULL && !(gBattleTypeFlags & BATTLE_TYPE_LINK))
{
ZeroEnemyPartyMons();
FreeMonSpritesGfx();
FreeBattleResources();
FreeBattleSpritesData();
Expand Down

0 comments on commit 4158367

Please sign in to comment.