From 3ffa7f993aca6611ad7d122992f708735ee18235 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sun, 10 Jan 2021 01:58:02 -0300 Subject: [PATCH] Renamed some X Defend labels to reflect its new name in the IE --- include/constants/item_effects.h | 2 +- src/battle_ai_switch_items.c | 2 +- src/pokemon.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/constants/item_effects.h b/include/constants/item_effects.h index 3e88ce4195..e68914c7b1 100644 --- a/include/constants/item_effects.h +++ b/include/constants/item_effects.h @@ -20,7 +20,7 @@ #else // new field 1 masks #define ITEM1_X_ATTACK 0x1 -#define ITEM1_X_DEFEND 0x2 +#define ITEM1_X_DEFENSE 0x2 #define ITEM1_X_SPEED 0x4 #define ITEM1_X_SPATK 0x8 #define ITEM1_X_SPDEF 0x10 diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 93020f6004..d0fd8224dd 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -903,7 +903,7 @@ static bool8 ShouldUseItem(void) #else if (itemEffects[1] & ITEM1_X_ATTACK) *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x1; - if (itemEffects[1] & ITEM1_X_DEFEND) + if (itemEffects[1] & ITEM1_X_DEFENSE) *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x2; if (itemEffects[1] & ITEM1_X_SPEED) *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x4; diff --git a/src/pokemon.c b/src/pokemon.c index fdb0176089..afcbf74cd4 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -4513,7 +4513,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov gBattleMons[gActiveBattler].statStages[STAT_ATK] = MAX_STAT_STAGE; retVal = FALSE; } - if ((itemEffect[cmdIndex] & ITEM1_X_DEFEND) + if ((itemEffect[cmdIndex] & ITEM1_X_DEFENSE) && gBattleMons[gActiveBattler].statStages[STAT_DEF] < MAX_STAT_STAGE) { if (B_X_ITEMS_BUFF == GEN_7) @@ -5188,7 +5188,7 @@ u8 *UseStatIncreaseItem(u16 itemId) case ITEM1_X_ATTACK: BufferStatRoseMessage(STAT_ATK); break; - case ITEM1_X_DEFEND: + case ITEM1_X_DEFENSE: BufferStatRoseMessage(STAT_DEF); break; case ITEM1_X_SPEED: