From fbd7d88e4f0b1499d0b611c25f45be5fc562caa5 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 15 Dec 2023 16:54:10 +0100 Subject: [PATCH] Fix regression introduced for Eject Button --- src/battle_script_commands.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index cfa2959f75..0a77522df0 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5853,7 +5853,8 @@ static void Cmd_moveend(void) if (IsBattlerAlive(battler) && gBattlerAttacker != battler && GetBattlerHoldEffect(battler, TRUE) == HOLD_EFFECT_EJECT_BUTTON - && TARGET_TURN_DAMAGED + && !DoesSubstituteBlockMove(gBattlerAttacker, battler, gCurrentMove) + && (gSpecialStatuses[battler].physicalDmg != 0 || gSpecialStatuses[battler].specialDmg != 0 || gBattleStruct->enduredDamage & gBitTable[battler]) && CountUsablePartyMons(battler) > 0) // Has mon to switch into { gBattleScripting.battler = battler;