Fixes encore random target for gen5+ (#7800)

This commit is contained in:
Alex 2025-09-30 17:50:22 +02:00 committed by GitHub
parent affd4f5bdd
commit 42c990ed29
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -415,7 +415,8 @@ void HandleAction_UseMove(void)
{
gCurrentMove = gChosenMove = gDisableStructs[gBattlerAttacker].encoredMove;
gCurrMovePos = gChosenMovePos = gDisableStructs[gBattlerAttacker].encoredMovePos;
gBattleStruct->moveTarget[gBattlerAttacker] = GetBattleMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE);
if (GetGenConfig(GEN_CONFIG_ENCORE_TARGET) < GEN_5)
gBattleStruct->moveTarget[gBattlerAttacker] = GetBattleMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE);
}
// check if the encored move wasn't overwritten
else if (GetActiveGimmick(gBattlerAttacker) != GIMMICK_Z_MOVE && gDisableStructs[gBattlerAttacker].encoredMove != MOVE_NONE