Fix "appearedInBattle" for single battles (#3728)

This commit is contained in:
benicioneto 2023-12-14 11:33:43 -03:00 committed by GitHub
parent 78fda2c19d
commit 15c8106a9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3787,9 +3787,6 @@ static void TryDoEventsBeforeFirstTurn(void)
*(gBattleStruct->monToSwitchIntoId + i) = PARTY_SIZE;
gChosenActionByBattler[i] = B_ACTION_NONE;
gChosenMoveByBattler[i] = MOVE_NONE;
// Record party slots of player's mons that appeared in battle
if (!BattlerHasAi(i))
gBattleStruct->appearedInBattle |= gBitTable[gBattlerPartyIndexes[i]];
}
TurnValuesCleanUp(FALSE);
SpecialStatusesClear();
@ -3802,7 +3799,12 @@ static void TryDoEventsBeforeFirstTurn(void)
gBattleCommunication[i] = 0;
for (i = 0; i < gBattlersCount; i++)
{
gBattleMons[i].status2 &= ~STATUS2_FLINCHED;
// Record party slots of player's mons that appeared in battle
if (!BattlerHasAi(i))
gBattleStruct->appearedInBattle |= gBitTable[gBattlerPartyIndexes[i]];
}
*(&gBattleStruct->turnEffectsTracker) = 0;
*(&gBattleStruct->turnEffectsBattlerId) = 0;