Merge pull request #4207 from ben-lear/mystery-encounters

handle undefined introVisuals properly
This commit is contained in:
ImperialSympathizer 2024-09-12 23:22:45 -04:00 committed by GitHub
commit cabb1692ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -366,8 +366,8 @@ export class EncounterPhase extends BattlePhase {
}
} else if (this.scene.currentBattle.battleType === BattleType.MYSTERY_ENCOUNTER && this.scene.currentBattle.mysteryEncounter) {
const encounter = this.scene.currentBattle.mysteryEncounter;
const introVisuals = encounter.introVisuals!;
introVisuals.playAnim();
const introVisuals = encounter.introVisuals;
introVisuals?.playAnim();
if (encounter.onVisualsStart) {
encounter.onVisualsStart(this.scene);