Fix OOB in Cmd_selectfirstvalidtarget (#7269)

This commit is contained in:
Alex 2025-07-04 18:11:32 +02:00 committed by GitHub
parent 56907bc26e
commit 5cfab59209
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14530,6 +14530,8 @@ static void Cmd_selectfirstvalidtarget(void)
if (IsBattlerAlive(gBattlerTarget))
break;
}
if (gBattlerTarget >= gBattlersCount)
gBattlerTarget = 0;
gBattlescriptCurrInstr = cmd->nextInstr;
}