From 66bd547d6caa186005274e03a6dfa392cb16eda3 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Tue, 7 Nov 2023 17:41:31 -0500 Subject: [PATCH] Fix crash with concurrent duplicate cries --- src/data/pokemon-species.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index 747df0ab68c..33f259004b2 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -208,6 +208,8 @@ export abstract class PokemonSpeciesForm { cry(scene: BattleScene, soundConfig?: Phaser.Types.Sound.SoundConfig, ignorePlay?: boolean): AnySound { const cryKey = this.getCryKey(this.formIndex); let cry = scene.sound.get(cryKey) as AnySound; + if (cry?.pendingRemove) + cry = null; cry = scene.playSound(cry || cryKey, soundConfig); if (ignorePlay) cry.stop();