From 3fd79984cd3c6d85a0585db08babc348a0739dc6 Mon Sep 17 00:00:00 2001 From: Felix Staud Date: Wed, 17 Jul 2024 16:06:08 -0700 Subject: [PATCH] add fallback for biomeMysteryEncounters if empty --- src/battle-scene.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index c0a3f0b090a..6cde5929308 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -2678,7 +2678,7 @@ export default class BattleScene extends SceneBase { let availableEncounters: IMysteryEncounter[] = []; // New encounter will never be the same as the most recent encounter const previousEncounter = this.mysteryEncounterData.encounteredEvents?.length > 0 ? this.mysteryEncounterData.encounteredEvents[this.mysteryEncounterData.encounteredEvents.length - 1][0] : null; - const biomeMysteryEncounters = mysteryEncountersByBiome.get(this.arena.biomeType); + const biomeMysteryEncounters = mysteryEncountersByBiome.get(this.arena.biomeType) ?? []; // If no valid encounters exist at tier, checks next tier down, continuing until there are some encounters available while (availableEncounters.length === 0 && tier >= 0) { availableEncounters = biomeMysteryEncounters