From a3cde2df59c8c5e503b46bbc5bd6548b91518637 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sat, 23 Mar 2024 15:29:22 -0400 Subject: [PATCH] Fix crash related to moves without battle animations --- src/data/battle-anims.ts | 2 ++ src/ui/egg-gacha-ui-handler.ts | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/data/battle-anims.ts b/src/data/battle-anims.ts index 644902c59..cec80190c 100644 --- a/src/data/battle-anims.ts +++ b/src/data/battle-anims.ts @@ -560,6 +560,8 @@ function loadAnimAssets(scene: BattleScene, anims: AnimConfig[], startLoad?: boo const backgrounds = new Set(); const sounds = new Set(); for (let a of anims) { + if (!a.frames?.length) + continue; const animSounds = a.getSoundResourceNames(); for (let ms of animSounds) sounds.add(ms); diff --git a/src/ui/egg-gacha-ui-handler.ts b/src/ui/egg-gacha-ui-handler.ts index 57672143f..7c69c3121 100644 --- a/src/ui/egg-gacha-ui-handler.ts +++ b/src/ui/egg-gacha-ui-handler.ts @@ -6,7 +6,6 @@ import * as Utils from "../utils"; import { EGG_SEED, Egg, GachaType, getEggTierDefaultHatchWaves, getEggDescriptor, getLegendaryGachaSpeciesForTimestamp } from "../data/egg"; import { VoucherType, getVoucherTypeIcon } from "../system/voucher"; import { getPokemonSpecies } from "../data/pokemon-species"; -import { Type } from "../data/type"; import { addWindow } from "./window"; import { Tutorial, handleTutorial } from "../tutorial"; import { EggTier } from "../data/enums/egg-type";