Fixes difficulty not being restored after tests (#8129)

This commit is contained in:
Philipp AUER 2025-11-04 10:36:25 +01:00 committed by GitHub
commit b179f79066
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -188,6 +188,7 @@ TEST("Difficulty default to Normal is the trainer doesn't have a member for the
CreateNPCTrainerPartyFromTrainer(testParty, &sTestTrainers[GetTrainerDifficultyLevelTest(currTrainer)][currTrainer], TRUE, BATTLE_TYPE_TRAINER);
EXPECT(GetMonData(&testParty[0], MON_DATA_SPECIES) == SPECIES_MEWTWO);
Free(testParty);
SetCurrentDifficultyLevel(DIFFICULTY_NORMAL);
}
TEST("Difficulty changes which party if used for NPCs if defined for the difficulty (EASY)")
@ -199,6 +200,7 @@ TEST("Difficulty changes which party if used for NPCs if defined for the difficu
EXPECT(GetMonData(&testParty[0], MON_DATA_SPECIES) == SPECIES_METAPOD);
EXPECT(GetMonData(&testParty[0], MON_DATA_LEVEL) == 1);
Free(testParty);
SetCurrentDifficultyLevel(DIFFICULTY_NORMAL);
}
TEST("Difficulty changes which party if used for NPCs if defined for the difficulty (HARD)")
@ -210,6 +212,7 @@ TEST("Difficulty changes which party if used for NPCs if defined for the difficu
EXPECT(GetMonData(&testParty[0], MON_DATA_SPECIES) == SPECIES_ARCEUS);
EXPECT(GetMonData(&testParty[0], MON_DATA_LEVEL) == 99);
Free(testParty);
SetCurrentDifficultyLevel(DIFFICULTY_NORMAL);
}
TEST("Difficulty changes which party if used for NPCs if defined for the difficulty (NORMAL)")

View File

@ -1344,6 +1344,7 @@ static void TearDownBattle(void)
// Zero out the parties, data in them could potentially carry over
ZeroPlayerPartyMons();
ZeroEnemyPartyMons();
SetCurrentDifficultyLevel(DIFFICULTY_NORMAL);
FreeMonSpritesGfx();
FreeBattleSpritesData();