Fix potential issue with abilities that would cause Toxic Chain to not activate

This commit is contained in:
PhallenTree 2024-06-18 11:50:30 +01:00 committed by GitHub
parent a26050fbde
commit 1fd23ec929
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7978,7 +7978,7 @@ u8 ItemBattleEffects(u8 caseID, u32 battler, bool32 moveTurn)
break;
case HOLD_EFFECT_CURE_STATUS: // only Toxic Chain's interaction with Knock Off
case HOLD_EFFECT_CURE_PSN:
if (gBattleMons[battler].status1 & STATUS1_PSN_ANY && !UnnerveOn(battler, gLastUsedItem) && gLastUsedAbility == ABILITY_TOXIC_CHAIN && gMovesInfo[gCurrentMove].effect == EFFECT_KNOCK_OFF)
if (gBattleMons[battler].status1 & STATUS1_PSN_ANY && !UnnerveOn(battler, gLastUsedItem) && GetBattlerAbility(gBattlerAttacker) == ABILITY_TOXIC_CHAIN && gMovesInfo[gCurrentMove].effect == EFFECT_KNOCK_OFF)
{
gBattleScripting.battler = battler;
gBattleMons[battler].status1 &= ~(STATUS1_PSN_ANY | STATUS1_TOXIC_COUNTER);