[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:
innerthunder 2024-11-15 08:56:05 -08:00 committed by GitHub
parent 8326e3556b
commit 9273b4930d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View File

@ -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;
}
}
/**

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,