mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-04-24 14:27:37 -04:00
Fix crash with concurrent duplicate cries
This commit is contained in:
parent
79c5b3d4f3
commit
66bd547d6c
1 changed files with 2 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue