[Bug] Ensure MEs disabled in a challenge mode only do so while challenge is active (#6337)

* Ensure MEs disabled in a challenge mode only do so while challenge is active

* Optimize checking disallowed challenges
This commit is contained in:
Sirz Benjie 2025-08-22 15:27:55 -05:00 committed by GitHub
parent af0b0b775f
commit edeb116ead
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3684,15 +3684,8 @@ export class BattleScene extends SceneBase {
) { ) {
return false; return false;
} }
if (this.gameMode.modeId === GameModes.CHALLENGE) { if (encounterCandidate.disallowedChallenges?.some(challenge => this.gameMode.hasChallenge(challenge))) {
const disallowedChallenges = encounterCandidate.disallowedChallenges; return false;
if (
disallowedChallenges &&
disallowedChallenges.length > 0 &&
this.gameMode.challenges.some(challenge => disallowedChallenges.includes(challenge.id))
) {
return false;
}
} }
if (!encounterCandidate.meetsRequirements()) { if (!encounterCandidate.meetsRequirements()) {
return false; return false;