diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 25250c480..1c4073706 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -212,7 +212,7 @@ u8 BattleAI_ChooseMoveOrAction(void) // Clear protect structures, some flags may be set during AI calcs // e.g. pranksterElevated from GetMovePriority - memset(&gProtectStructs[gActiveBattler], 0, sizeof(struct ProtectStruct)); + memset(&gProtectStructs, 0, MAX_BATTLERS_COUNT * sizeof(struct ProtectStruct)); gCurrentMove = savedCurrentMove; return ret;