From c981fb3b2e0e39634525d4a4bd29ab6992d68568 Mon Sep 17 00:00:00 2001 From: grintoul1 Date: Mon, 3 Nov 2025 18:34:54 +0000 Subject: [PATCH] Fixes difficulty not being restored after tests --- test/battle/trainer_control.c | 3 +++ test/test_runner_battle.c | 1 + 2 files changed, 4 insertions(+) diff --git a/test/battle/trainer_control.c b/test/battle/trainer_control.c index 663a720d3d..1821cebcb5 100644 --- a/test/battle/trainer_control.c +++ b/test/battle/trainer_control.c @@ -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)") diff --git a/test/test_runner_battle.c b/test/test_runner_battle.c index 157cec9018..395381d1d2 100644 --- a/test/test_runner_battle.c +++ b/test/test_runner_battle.c @@ -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();