Prevent sameMoveTurns from incrementing when unable to use move (#6167)

This commit is contained in:
moostoet 2025-02-02 22:11:25 +01:00 committed by GitHub
parent a0097ef395
commit ddff2def40
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6744,7 +6744,7 @@ static void Cmd_moveend(void)
gBattleScripting.moveendState++;
break;
case MOVEEND_SAME_MOVE_TURNS:
if (gCurrentMove != gLastResultingMoves[gBattlerAttacker] || gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
if (gCurrentMove != gLastResultingMoves[gBattlerAttacker] || gMoveResultFlags & MOVE_RESULT_NO_EFFECT || gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE)
gBattleStruct->sameMoveTurns[gBattlerAttacker] = 0;
else if (gCurrentMove == gLastResultingMoves[gBattlerAttacker] && gSpecialStatuses[gBattlerAttacker].parentalBondState != PARENTAL_BOND_1ST_HIT)
gBattleStruct->sameMoveTurns[gBattlerAttacker]++;