mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-26 08:46:55 +00:00
Fix crash with concurrent duplicate cries
This commit is contained in:
parent
79c5b3d4f3
commit
66bd547d6c
@ -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…
Reference in New Issue
Block a user