From 95dac7c4acb7fea7b3d4af866194236eee7d4926 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Tue, 17 Sep 2024 20:58:43 +0200 Subject: [PATCH] Remove potential uninitialized behavior (#5393) `MAX_BATTLERS_COUNT` makes more sense to use here because we iterate over max battlers in the first place. --- src/battle_script_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 04f3c966bb..698b8db4b4 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -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];