Fix crash with playing battle animation for target not on field

This commit is contained in:
Flashfyre 2023-10-28 21:03:36 -04:00
parent 06740130b9
commit e0a63a9ed6

View File

@ -618,6 +618,12 @@ export abstract class BattleAnim {
const user = !isOppAnim ? this.user : this.target; const user = !isOppAnim ? this.user : this.target;
const target = !isOppAnim ? this.target : this.user; const target = !isOppAnim ? this.target : this.user;
if (!target.isOnField()) {
if (callback)
callback();
return;
}
const userSprite = user.getSprite(); const userSprite = user.getSprite();
const targetSprite = target.getSprite(); const targetSprite = target.getSprite();