From b6711441f548dfac4a9b1c69d19aa3d28a3b1ec3 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 3 Apr 2021 15:18:17 -0400 Subject: Fix AI Guard Spec use, and Specs->Spec --- src/battle_util.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/battle_util.c') diff --git a/src/battle_util.c b/src/battle_util.c index e2dfeef27..cbcd445b7 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -378,10 +378,19 @@ void HandleAction_UseItem(void) gBattleScripting.animArg2 = 0; } break; - case AI_ITEM_GUARD_SPECS: + case AI_ITEM_GUARD_SPEC: + // It seems probable that at some point there was a special message for + // an AI trainer using Guard Spec in a double battle. + // There isn't now however, and the assignment to 2 below goes out of + // bounds for gMistUsedStringIds and instead prints "{mon} is getting pumped" + // from the next table, gFocusEnergyUsedStringIds. + // In any case this isn't an issue in the retail version, as no trainers + // are ever given any Guard Spec to use. +#ifndef UBFIX if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) - gBattleCommunication[MULTISTRING_CHOOSER] = 2; // Going OOB for gMistUsedStringIds? + gBattleCommunication[MULTISTRING_CHOOSER] = 2; else +#endif gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_MIST; break; } -- cgit v1.2.3