diff --git a/include/battle.h b/include/battle.h index 29cc79d36be3..b328b46bb254 100644 --- a/include/battle.h +++ b/include/battle.h @@ -479,7 +479,6 @@ struct MegaEvolutionData bool8 playerSelect; u8 triggerSpriteId; bool8 isWishMegaEvo; - bool32 didMegaEvo[PARTY_SIZE][2]; // For each party member and side. }; struct Illusion diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 1232775fd06e..eaa7bbde1a69 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8840,7 +8840,6 @@ static void Cmd_various(void) gBattleMons[gActiveBattler].species = megaSpecies; PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gActiveBattler].species); - gBattleStruct->mega.didMegaEvo[gActiveBattler][GetBattlerSide(gActiveBattler)] = TRUE; BtlController_EmitSetMonData(BUFFER_A, REQUEST_SPECIES_BATTLE, gBitTable[gBattlerPartyIndexes[gActiveBattler]], sizeof(gBattleMons[gActiveBattler].species), &gBattleMons[gActiveBattler].species); MarkBattlerForControllerExec(gActiveBattler); diff --git a/src/battle_util.c b/src/battle_util.c index 0b0ab3a04080..94fb078dacba 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -2110,10 +2110,11 @@ u32 GetBattlerFriendshipScore(u8 battlerId) struct MegaEvolutionData *mega = &(((struct ChooseMoveStruct *)(&gBattleResources->bufferA[battlerId][4]))->mega); u8 side = GetBattlerSide(battlerId); struct Pokemon *party = (side == B_SIDE_PLAYER) ? gPlayerParty : gEnemyParty; + u16 species = GetMonData(&party[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES); if (side != B_SIDE_PLAYER) return FRIENDSHIP_NONE; - else if (gBattleStruct->mega.didMegaEvo[battlerId][side] + else if (gBaseStats[species].flags & SPECIES_FLAG_MEGA_EVOLUTION || (gBattleTypeFlags & (BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_LINK