link battles mega evo fix hopefully?????

This commit is contained in:
DizzyEggg 2018-09-20 17:59:17 +02:00
parent 2bae70a66b
commit 0755240fbc
3 changed files with 5 additions and 2 deletions

View File

@ -113,6 +113,7 @@ struct ChooseMoveStruct
u16 species;
u8 monType1;
u8 monType2;
struct MegaEvolutionData mega;
};
enum

View File

@ -4224,6 +4224,7 @@ static void HandleTurnActionSelectionState(void)
{
struct ChooseMoveStruct moveInfo;
moveInfo.mega = gBattleStruct->mega;
moveInfo.species = gBattleMons[gActiveBattler].species;
moveInfo.monType1 = gBattleMons[gActiveBattler].type1;
moveInfo.monType2 = gBattleMons[gActiveBattler].type2;

View File

@ -5605,14 +5605,15 @@ bool32 CanMegaEvolve(u8 battlerId)
struct Pokemon *mon;
u8 battlerPosition = GetBattlerPosition(battlerId);
u8 partnerPosition = GetBattlerPosition(BATTLE_PARTNER(battlerId));
struct MegaEvolutionData *mega = &(((struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]))->mega);
// Check if trainer already mega evolved a pokemon.
if (gBattleStruct->mega.alreadyEvolved[battlerPosition])
if (mega->alreadyEvolved[battlerPosition])
return FALSE;
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
{
if (IsPartnerMonFromSameTrainer(battlerId)
&& (gBattleStruct->mega.alreadyEvolved[partnerPosition] || (gBattleStruct->mega.toEvolve & gBitTable[BATTLE_PARTNER(battlerId)])))
&& (mega->alreadyEvolved[partnerPosition] || (mega->toEvolve & gBitTable[BATTLE_PARTNER(battlerId)])))
return FALSE;
}