From de64fd77203e0c3040cb84e3afb3fa68a9073306 Mon Sep 17 00:00:00 2001 From: PigeonBar <56974298+PigeonBar@users.noreply.github.com> Date: Thu, 17 Oct 2024 23:52:46 -0400 Subject: [PATCH] [Misc] [Beta] Fix crash when loading save preview with Mystery Encounter Override active (#4683) --- src/battle-scene.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index ffba8e98d34..c6fff1e209a 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -3177,6 +3177,9 @@ export default class BattleScene extends SceneBase { let encounter: MysteryEncounter | null; if (!isNullOrUndefined(Overrides.MYSTERY_ENCOUNTER_OVERRIDE) && allMysteryEncounters.hasOwnProperty(Overrides.MYSTERY_ENCOUNTER_OVERRIDE)) { encounter = allMysteryEncounters[Overrides.MYSTERY_ENCOUNTER_OVERRIDE]; + if (canBypass) { + return encounter; + } } else if (canBypass) { encounter = allMysteryEncounters[encounterType ?? -1]; return encounter;