Fixed protect not resetting the counter in earlier gens (#6342)

Co-authored-by: Hedara <hedara90@gmail.com>
This commit is contained in:
hedara90 2025-02-26 15:07:54 +01:00 committed by GitHub
parent cf481b1343
commit 56a3819b61
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11035,7 +11035,8 @@ static void TryResetProtectUseCounter(u32 battler)
u32 lastMove = gLastResultingMoves[battler];
if (lastMove == MOVE_UNAVAILABLE
|| (!gBattleMoveEffects[gMovesInfo[lastMove].effect].usesProtectCounter
&& (B_ALLY_SWITCH_FAIL_CHANCE >= GEN_9 && gMovesInfo[lastMove].effect != EFFECT_ALLY_SWITCH)))
&& ((B_ALLY_SWITCH_FAIL_CHANCE >= GEN_9 && gMovesInfo[lastMove].effect != EFFECT_ALLY_SWITCH)
|| B_ALLY_SWITCH_FAIL_CHANCE < GEN_9)))
gDisableStructs[battler].protectUses = 0;
}