diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2021-04-03 15:18:17 -0400 |
---|---|---|
committer | GriffinR <griffin.g.richards@gmail.com> | 2021-04-03 15:18:17 -0400 |
commit | b6711441f548dfac4a9b1c69d19aa3d28a3b1ec3 (patch) | |
tree | b938e4ee131c5da5ffbd063c01904dcf3faba9f7 /src | |
parent | f4d8a91ba44d7bcf0f9df8db7ca5f7aeb688497f (diff) |
Fix AI Guard Spec use, and Specs->Spec
Diffstat (limited to 'src')
-rw-r--r-- | src/battle_ai_switch_items.c | 4 | ||||
-rw-r--r-- | src/battle_util.c | 13 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index e92630808..04122b17d 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -789,7 +789,7 @@ static u8 GetAI_ItemType(u8 itemId, const u8 *itemEffect) // NOTE: should take u else if (itemEffect[0] & (ITEM0_DIRE_HIT | ITEM0_X_ATTACK) || itemEffect[1] != 0 || itemEffect[2] != 0) return AI_ITEM_X_STAT; else if (itemEffect[3] & ITEM3_GUARD_SPEC) - return AI_ITEM_GUARD_SPECS; + return AI_ITEM_GUARD_SPEC; else return AI_ITEM_NOT_RECOGNIZABLE; } @@ -911,7 +911,7 @@ static bool8 ShouldUseItem(void) *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_DIRE_HIT); shouldUse = TRUE; break; - case AI_ITEM_GUARD_SPECS: + case AI_ITEM_GUARD_SPEC: battlerSide = GetBattlerSide(gActiveBattler); if (gDisableStructs[gActiveBattler].isFirstTurn != 0 && gSideTimers[battlerSide].mistTimer == 0) shouldUse = TRUE; 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; } |