Fixed Sticky Hold not being negated by Gastro Acid when stealing and switching items

This commit is contained in:
Eduardo Quezada D'Ottone 2021-10-02 14:47:38 -03:00
parent b322a42fea
commit 9aee8cbea5

View File

@ -3067,7 +3067,7 @@ void SetMoveEffect(bool32 primary, u32 certain)
gBattlescriptCurrInstr++;
}
else if (gBattleMons[gBattlerTarget].item
&& gBattleMons[gBattlerTarget].ability == ABILITY_STICKY_HOLD)
&& GetBattlerAbility(gBattlerTarget) == ABILITY_STICKY_HOLD)
{
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_NoItemSteal;
@ -11615,7 +11615,7 @@ static void Cmd_tryswapitems(void) // trick
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
}
// check if ability prevents swapping
else if (gBattleMons[gBattlerTarget].ability == ABILITY_STICKY_HOLD)
else if (GetBattlerAbility(gBattlerTarget) == ABILITY_STICKY_HOLD)
{
gBattlescriptCurrInstr = BattleScript_StickyHoldActivates;
gLastUsedAbility = gBattleMons[gBattlerTarget].ability;