From 8427d47ea5616410560be573f7280125e595c674 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sat, 11 Jan 2025 09:36:00 -0300 Subject: [PATCH] Fixed Gimmick tests failing when running first (#6001) --- test/battle/gimmick/dynamax.c | 2 -- test/test_runner_battle.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/test/battle/gimmick/dynamax.c b/test/battle/gimmick/dynamax.c index 0e3ae532bf..91773b01bc 100644 --- a/test/battle/gimmick/dynamax.c +++ b/test/battle/gimmick/dynamax.c @@ -458,7 +458,6 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Max Moves deal 1/4 damage through protect", s16 da } } -// This test will fail if it's the first test a thread runs SINGLE_BATTLE_TEST("(DYNAMAX) Max Moves don't bypass Max Guard") { GIVEN { @@ -1536,7 +1535,6 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Moxie clones can be triggered by Max Moves faintin } } -// This test will fail if it's the first test a thread runs SINGLE_BATTLE_TEST("(DYNAMAX) Max Attacks prints a message when hitting into Max Guard") { GIVEN { diff --git a/test/test_runner_battle.c b/test/test_runner_battle.c index 9484e6df6c..5340ddb4c9 100644 --- a/test/test_runner_battle.c +++ b/test/test_runner_battle.c @@ -2117,7 +2117,7 @@ void MoveGetIdAndSlot(s32 battlerId, struct MoveContext *ctx, u32 *moveId, u32 * u32 item = GetMonData(mon, MON_DATA_HELD_ITEM); u32 holdEffect = ItemId_GetHoldEffect(item); u32 species = GetMonData(mon, MON_DATA_SPECIES); - u32 side = GetBattlerSide(battlerId); + u32 side = battlerId & BIT_SIDE; // Check invalid item usage. INVALID_IF(ctx->gimmick == GIMMICK_MEGA && holdEffect != HOLD_EFFECT_MEGA_STONE && species != SPECIES_RAYQUAZA, "Cannot Mega Evolve without a Mega Stone");