Corrected Link Multi flag checks for party allocation

This commit is contained in:
grintoul1 2026-02-09 15:35:07 +00:00
parent a74601fd60
commit 202b0fc1b3
2 changed files with 2 additions and 13 deletions

View File

@ -1125,17 +1125,6 @@ static inline u32 GetOpposingSideBattler(enum BattlerId battler)
return GetBattlerAtPosition(BATTLE_OPPOSITE(GetBattlerSide(battler)));
}
static inline struct Pokemon *GetSideParty(enum BattleSide side)
{
switch (side)
{
case B_SIDE_OPPONENT:
return gParties[B_TRAINER_1];
default:
return gParties[B_TRAINER_0];
}
}
static inline struct PartyState *GetBattlerPartyState(enum BattlerId battler)
{
return &gBattleStruct->partyState[GetBattlerSide(battler)][gBattlerPartyIndexes[battler]];

View File

@ -237,8 +237,8 @@ u32 BattlePalace_TryEscapeStatus(enum BattlerId battler)
struct Pokemon *GetBattlerParty(enum BattlerId battler)
{
if ((gBattleTypeFlags & BATTLE_TYPE_LINK && gBattleTypeFlags & BATTLE_TYPE_MULTI))
return GetSideParty(GetBattlerSide(battler));
if ((gBattleTypeFlags & BATTLE_TYPE_LINK && gBattleTypeFlags & BATTLE_TYPE_MULTI) && (battler & BIT_FLANK) != B_FLANK_LEFT)
return gParties[GetAllyTrainerFromBattler(battler)];
return gParties[GetBattlerTrainer(battler)];
}