Running from trainer battles properly handles whiteouts (#9228)

This commit is contained in:
psf 2026-02-16 13:58:57 -08:00 committed by GitHub
parent 9119a6cc53
commit d01442299a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1321,6 +1321,13 @@ static void CB2_EndTrainerBattle(void)
DowngradeBadPoison();
SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic);
}
else if (DidPlayerForfeitNormalTrainerBattle())
{
if (FlagGet(B_FLAG_NO_WHITEOUT) || CurrentBattlePyramidLocation() != PYRAMID_LOCATION_NONE || InTrainerHillChallenge())
SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic);
else
SetMainCallback2(CB2_WhiteOut);
}
else if (IsPlayerDefeated(gBattleOutcome) == TRUE)
{
if (CurrentBattlePyramidLocation() != PYRAMID_LOCATION_NONE || InTrainerHillChallenge() || (!NoAliveMonsForPlayer()) || FlagGet(B_FLAG_NO_WHITEOUT))
@ -1328,10 +1335,6 @@ static void CB2_EndTrainerBattle(void)
else
SetMainCallback2(CB2_WhiteOut);
}
else if (DidPlayerForfeitNormalTrainerBattle())
{
SetMainCallback2(CB2_WhiteOut);
}
else
{
SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic);