mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-26 00:36:25 +00:00
Fix crash when playing weather animation before a trainer battle
This commit is contained in:
parent
1fd342aa11
commit
d135591b75
@ -330,7 +330,9 @@ class AnimTimedAddBgEvent extends AnimTimedBgEvent {
|
||||
moveAnim.bgSprite.setScale(1.25);
|
||||
moveAnim.bgSprite.setAlpha(this.opacity / 255);
|
||||
scene.field.add(moveAnim.bgSprite);
|
||||
scene.field.moveBelow(moveAnim.bgSprite as Phaser.GameObjects.GameObject, scene.getEnemyPokemon() || scene.getPlayerPokemon());
|
||||
const fieldPokemon = scene.getEnemyPokemon() || scene.getPlayerPokemon();
|
||||
if (fieldPokemon?.isOnField())
|
||||
scene.field.moveBelow(moveAnim.bgSprite as Phaser.GameObjects.GameObject, fieldPokemon);
|
||||
|
||||
scene.tweens.add({
|
||||
targets: moveAnim.bgSprite,
|
||||
|
Loading…
Reference in New Issue
Block a user