Fix crash with playing battle animation for target not on field

pull/2/head
Flashfyre 2023-10-28 21:03:36 -04:00
parent 06740130b9
commit e0a63a9ed6
1 changed files with 6 additions and 0 deletions

View File

@ -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();