Add failsafe to Commander remove anim

This commit is contained in:
innerthunder 2024-11-14 17:43:14 -08:00
parent f778bd5877
commit 502b1a20c5

View File

@ -312,6 +312,10 @@ export class PokemonAnimPhase extends BattlePhase {
// Note: unlike the other Commander animation, this is played through the
// Dondozo instead of the Tatsugiri.
const tatsugiri = this.pokemon.getAlly();
if (isNullOrUndefined(tatsugiri)) {
console.warn("Aborting COMMANDER_REMOVE anim: Tatsugiri is undefined");
return this.end();
}
const tatsuSprite = this.scene.addPokemonSprite(
tatsugiri,