mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 19:47:35 +01:00
TearDownBattle function
This commit is contained in:
parent
c911d4bf57
commit
3e6f499517
@ -841,6 +841,14 @@ void TestRunner_Battle_AfterLastTurn(void)
|
|||||||
STATE->runFinally = FALSE;
|
STATE->runFinally = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void TearDownBattle(void)
|
||||||
|
{
|
||||||
|
FreeMonSpritesGfx();
|
||||||
|
FreeBattleSpritesData();
|
||||||
|
FreeBattleResources();
|
||||||
|
FreeAllWindowBuffers();
|
||||||
|
}
|
||||||
|
|
||||||
static void CB2_BattleTest_NextParameter(void)
|
static void CB2_BattleTest_NextParameter(void)
|
||||||
{
|
{
|
||||||
if (++STATE->runParameter >= STATE->parameters)
|
if (++STATE->runParameter >= STATE->parameters)
|
||||||
@ -856,10 +864,7 @@ static void CB2_BattleTest_NextParameter(void)
|
|||||||
|
|
||||||
static void CB2_BattleTest_NextTrial(void)
|
static void CB2_BattleTest_NextTrial(void)
|
||||||
{
|
{
|
||||||
FreeMonSpritesGfx();
|
TearDownBattle();
|
||||||
FreeBattleSpritesData();
|
|
||||||
FreeBattleResources();
|
|
||||||
FreeAllWindowBuffers();
|
|
||||||
|
|
||||||
SetMainCallback2(CB2_BattleTest_NextParameter);
|
SetMainCallback2(CB2_BattleTest_NextParameter);
|
||||||
|
|
||||||
@ -903,12 +908,7 @@ static void BattleTest_TearDown(void *data)
|
|||||||
// Free resources that aren't cleaned up when the battle was
|
// Free resources that aren't cleaned up when the battle was
|
||||||
// aborted unexpectedly.
|
// aborted unexpectedly.
|
||||||
if (STATE->tearDownBattle)
|
if (STATE->tearDownBattle)
|
||||||
{
|
TearDownBattle();
|
||||||
FreeMonSpritesGfx();
|
|
||||||
FreeBattleSpritesData();
|
|
||||||
FreeBattleResources();
|
|
||||||
FreeAllWindowBuffers();
|
|
||||||
}
|
|
||||||
FREE_AND_SET_NULL(STATE->results);
|
FREE_AND_SET_NULL(STATE->results);
|
||||||
FREE_AND_SET_NULL(STATE);
|
FREE_AND_SET_NULL(STATE);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user