[Beta][P1] Fix crash when resetting Commanded Dondozo before Trainer battles (#4873)
* Add failsafe to Commander remove anim * Commanded tag saves Tatsu form on reload
This commit is contained in:
parent
8326e3556b
commit
9273b4930d
|
@ -2158,6 +2158,11 @@ export class CommandedTag extends BattlerTag {
|
|||
pokemon.scene.triggerPokemonBattleAnim(pokemon, PokemonAnimType.COMMANDER_REMOVE);
|
||||
}
|
||||
}
|
||||
|
||||
override loadTag(source: BattlerTag | any): void {
|
||||
super.loadTag(source);
|
||||
this._tatsugiriFormKey = source._tatsugiriFormKey;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue