From 79f39a1fd04a87b6b6381da8349f9220a8251399 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Fri, 3 Sep 2021 14:56:36 -0400 Subject: [PATCH] fix eject button --- data/battle_scripts_1.s | 1 - src/battle_script_commands.c | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index c19812433..c7256dc7e 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -8057,7 +8057,6 @@ BattleScript_RedCardSuctionCups: return BattleScript_EjectButtonActivates:: - jumpifcantswitch BS_SCRIPTING, BattleScript_EjectButtonEnd makevisible BS_ATTACKER playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_EJECTBUTTONACTIVATE diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 7cc12b391..9f1b0ba93 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5070,11 +5070,12 @@ static void Cmd_moveend(void) case MOVEEND_EJECT_BUTTON: if (gCurrentMove != MOVE_DRAGON_TAIL && gCurrentMove != MOVE_CIRCLE_THROW - && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && IsBattlerAlive(gBattlerAttacker) && !TestSheerForceFlag(gBattlerAttacker, gCurrentMove) && (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER || (gBattleTypeFlags & BATTLE_TYPE_TRAINER))) { + // Since we check if battler was damaged, we don't need to check move result. + // In fact, doing so actually prevents multi-target moves from activating eject button properly u8 battlers[4] = {0, 1, 2, 3}; SortBattlersBySpeed(battlers, FALSE); for (i = 0; i < gBattlersCount; i++) @@ -5106,7 +5107,7 @@ static void Cmd_moveend(void) && IsBattlerAlive(gBattlerAttacker) && !TestSheerForceFlag(gBattlerAttacker, gCurrentMove)) { - // since we check if battler was damaged, we don't need to check move result. + // Since we check if battler was damaged, we don't need to check move result. // In fact, doing so actually prevents multi-target moves from activating red card properly u8 battlers[4] = {0, 1, 2, 3}; SortBattlersBySpeed(battlers, FALSE);