From e0a63a9ed67bfc3e138ac5f41946013a51ee9276 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sat, 28 Oct 2023 21:03:36 -0400 Subject: [PATCH] Fix crash with playing battle animation for target not on field --- src/data/battle-anims.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/data/battle-anims.ts b/src/data/battle-anims.ts index 81f2c2752..705a46817 100644 --- a/src/data/battle-anims.ts +++ b/src/data/battle-anims.ts @@ -618,6 +618,12 @@ export abstract class BattleAnim { const user = !isOppAnim ? this.user : this.target; const target = !isOppAnim ? this.target : this.user; + if (!target.isOnField()) { + if (callback) + callback(); + return; + } + const userSprite = user.getSprite(); const targetSprite = target.getSprite();