mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-27 04:04:17 +01:00
link battles mega evo fix hopefully?????
This commit is contained in:
parent
2bae70a66b
commit
0755240fbc
@ -113,6 +113,7 @@ struct ChooseMoveStruct
|
||||
u16 species;
|
||||
u8 monType1;
|
||||
u8 monType2;
|
||||
struct MegaEvolutionData mega;
|
||||
};
|
||||
|
||||
enum
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user