Skip to content

Commit

Permalink
Remove potential uninitialized behavior (#5393)
Browse files Browse the repository at this point in the history
`MAX_BATTLERS_COUNT` makes more sense to use here because we iterate over max battlers in the first place.
  • Loading branch information
AlexOn1ine authored Sep 17, 2024
1 parent 6116b8b commit 95dac7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -8935,7 +8935,7 @@ static bool32 ChangeOrderTargetAfterAttacker(void)
|| GetBattlerTurnOrderNum(gBattlerAttacker) + 1 == GetBattlerTurnOrderNum(gBattlerTarget))
return FALSE;

for (i = 0; i < gBattlersCount; i++)
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
{
data[i] = gBattlerByTurnOrder[i];
actionsData[i] = gActionsByTurnOrder[i];
Expand Down

0 comments on commit 95dac7c

Please sign in to comment.