Check for the correct battler's No Guard. (#4320)

This commit is contained in:
Zimmermann Gyula 2024-03-30 11:46:15 +01:00 committed by GitHub
parent 0acd058c16
commit 8f6f744e7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1546,7 +1546,7 @@ static bool32 AccuracyCalcHelper(u16 move)
return TRUE;
}
// If the attacker has the ability No Guard and they aren't targeting a Pokemon involved in a Sky Drop with the move Sky Drop, move hits.
else if (GetBattlerAbility(gBattlerTarget) == ABILITY_NO_GUARD && (move != MOVE_SKY_DROP || gBattleStruct->skyDropTargets[gBattlerTarget] == 0xFF))
else if (GetBattlerAbility(gBattlerAttacker) == ABILITY_NO_GUARD && (move != MOVE_SKY_DROP || gBattleStruct->skyDropTargets[gBattlerTarget] == 0xFF))
{
if (!JumpIfMoveFailed(7, move))
RecordAbilityBattle(gBattlerAttacker, ABILITY_NO_GUARD);