Added a check for the Mega Bracelet in CanMegaEvolve

This commit is contained in:
LOuroboros 2021-03-10 08:52:43 -03:00
parent acf9bb0a17
commit aa4c28dcf3

View File

@ -7834,6 +7834,13 @@ bool32 CanMegaEvolve(u8 battlerId)
u8 partnerPosition = GetBattlerPosition(BATTLE_PARTNER(battlerId));
struct MegaEvolutionData *mega = &(((struct ChooseMoveStruct*)(&gBattleResources->bufferA[gActiveBattler][4]))->mega);
#ifdef ITEM_EXPANSION
// Check if Player has a Mega Bracelet
if ((GetBattlerPosition(battlerId) == B_POSITION_PLAYER_LEFT || (!(gBattleTypeFlags & BATTLE_TYPE_MULTI) && GetBattlerPosition(battlerId) == B_POSITION_PLAYER_RIGHT))
&& !CheckBagHasItem(ITEM_MEGA_BRACELET, 1))
return FALSE;
#endif
// Check if trainer already mega evolved a pokemon.
if (mega->alreadyEvolved[battlerPosition])
return FALSE;