From 1afc43a0e8259ad1b1f025f544cfec1884c68fdb Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Wed, 6 Oct 2021 15:30:44 -0400 Subject: [PATCH] fix DoesSubstituteBlockMove calls --- src/battle_script_commands.c | 6 +++--- src/battle_util.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 12f7763e3..35c5fee1a 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5139,7 +5139,7 @@ static void Cmd_moveend(void) // Attacker is the damage-dealer, battler is mon to be switched out if (IsBattlerAlive(battler) && GetBattlerHoldEffect(battler, TRUE) == HOLD_EFFECT_EJECT_BUTTON - && !DoesSubstituteBlockMove(gCurrentMove, gBattlerAttacker, battler) + && !DoesSubstituteBlockMove(gBattlerAttacker, battler, gCurrentMove) && (gSpecialStatuses[battler].physicalDmg != 0 || gSpecialStatuses[battler].specialDmg != 0) && CountUsablePartyMons(battler) > 0) // Has mon to switch into { @@ -5173,7 +5173,7 @@ static void Cmd_moveend(void) // Attacker is the one to be switched out, battler is one with red card if (battler != gBattlerAttacker && IsBattlerAlive(battler) - && !DoesSubstituteBlockMove(gCurrentMove, gBattlerAttacker, battler) + && !DoesSubstituteBlockMove(gBattlerAttacker, battler, gCurrentMove) && GetBattlerHoldEffect(battler, TRUE) == HOLD_EFFECT_RED_CARD && (gSpecialStatuses[battler].physicalDmg != 0 || gSpecialStatuses[battler].specialDmg != 0) && CanBattlerSwitch(gBattlerAttacker)) @@ -5240,7 +5240,7 @@ static void Cmd_moveend(void) if (battler != gBattlerAttacker // Cannot pickpocket yourself && GetBattlerAbility(battler) == ABILITY_PICKPOCKET // Target must have pickpocket ability && BATTLER_DAMAGED(battler) // Target needs to have been damaged - && !DoesSubstituteBlockMove(gCurrentMove, gBattlerAttacker, battler) // Subsitute unaffected + && !DoesSubstituteBlockMove(gBattlerAttacker, battler, gCurrentMove) // Subsitute unaffected && IsBattlerAlive(battler) // Battler must be alive to pickpocket && gBattleMons[battler].item == ITEM_NONE // Pickpocketer can't have an item already && CanStealItem(battler, gBattlerAttacker, gBattleMons[gBattlerAttacker].item)) // Cannot steal plates, mega stones, etc diff --git a/src/battle_util.c b/src/battle_util.c index a709aaf9e..31e5e14fc 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -6810,7 +6810,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) if (TARGET_TURN_DAMAGED && (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) && IsMoveMakingContact(gCurrentMove, gBattlerAttacker) - && !DoesSubstituteBlockMove(gCurrentMove, gBattlerAttacker, battlerId) + && !DoesSubstituteBlockMove(gBattlerAttacker, battlerId, gCurrentMove) && IsBattlerAlive(gBattlerAttacker) && CanStealItem(gBattlerAttacker, gBattlerTarget, gBattleMons[gBattlerTarget].item) && gBattleMons[gBattlerAttacker].item == ITEM_NONE)