Fix battle arena counting all judges loss for the opponent (#8046)

This commit is contained in:
FosterProgramming 2025-10-26 15:28:40 +01:00 committed by GitHub
parent 292d9b2933
commit a9486a5521
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17102,11 +17102,14 @@ void BS_ArenaJudgmentWindow(void)
gBattlescriptCurrInstr = cmd->nextInstr;
}
static void SetArenMonLostValues(u32 battler)
static void SetArenMonLostValues(u32 battler, u32 side)
{
gBattleMons[battler].hp = 0;
gHitMarker |= HITMARKER_FAINTED(battler);
gBattleStruct->arenaLostOpponentMons |= 1u << gBattlerPartyIndexes[battler];
if (side == B_SIDE_PLAYER)
gBattleStruct->arenaLostPlayerMons |= 1u << gBattlerPartyIndexes[battler];
else
gBattleStruct->arenaLostOpponentMons |= 1u << gBattlerPartyIndexes[battler];
gDisableStructs[battler].truantSwitchInHack = TRUE;
}
@ -17115,22 +17118,22 @@ static void SetArenMonLostValues(u32 battler)
void BS_ArenaOpponentMonLost(void)
{
NATIVE_ARGS();
SetArenMonLostValues(opponentMon);
SetArenMonLostValues(opponentMon, B_SIDE_OPPONENT);
gBattlescriptCurrInstr = cmd->nextInstr;
}
void BS_ArenaPlayerMonLost(void)
{
NATIVE_ARGS();
SetArenMonLostValues(playerMon);
SetArenMonLostValues(playerMon, B_SIDE_PLAYER);
gBattlescriptCurrInstr = cmd->nextInstr;
}
void BS_ArenaBothMonsLost(void)
{
NATIVE_ARGS();
SetArenMonLostValues(playerMon);
SetArenMonLostValues(opponentMon);
SetArenMonLostValues(playerMon, B_SIDE_PLAYER);
SetArenMonLostValues(opponentMon, B_SIDE_OPPONENT);
gBattlescriptCurrInstr = cmd->nextInstr;
}
#undef playerMon