mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-29 02:06:07 +00:00
catch Sprite.play() errors in egg hatch phase
This commit is contained in:
parent
4821df68f2
commit
a9adc14988
@ -329,7 +329,12 @@ export class EggHatchPhase extends Phase {
|
||||
this.scene.validateAchv(achvs.HATCH_SHINY);
|
||||
}
|
||||
this.eggContainer.setVisible(false);
|
||||
this.pokemonSprite.play(this.pokemon.getSpriteKey(true));
|
||||
const spriteKey = this.pokemon.getSpriteKey(true);
|
||||
try {
|
||||
this.pokemonSprite.play(spriteKey);
|
||||
} catch (err: unknown) {
|
||||
console.error(`Failed to play animation for ${spriteKey}`, err);
|
||||
}
|
||||
this.pokemonSprite.setPipelineData("ignoreTimeTint", true);
|
||||
this.pokemonSprite.setPipelineData("spriteKey", this.pokemon.getSpriteKey());
|
||||
this.pokemonSprite.setPipelineData("shiny", this.pokemon.shiny);
|
||||
|
Loading…
Reference in New Issue
Block a user