[Misc] [Beta] Fix crash when loading save preview with Mystery Encounter Override active (#4683)

This commit is contained in:
PigeonBar 2024-10-17 23:52:46 -04:00 committed by GitHub
parent c5b3220b86
commit de64fd7720
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;