Fix form change edge case causing crash

This commit is contained in:
Flashfyre 2024-02-20 15:44:35 -05:00
parent c848755426
commit d4eae67768
1 changed files with 7 additions and 0 deletions

View File

@ -186,6 +186,13 @@ export class QuietFormChangePhase extends BattlePhase {
const preName = this.pokemon.name; const preName = this.pokemon.name;
if (!this.pokemon.isOnField()) {
this.pokemon.changeForm(this.formChange).then(() => {
this.scene.ui.showText(getSpeciesFormChangeMessage(this.pokemon, this.formChange, preName), null, () => this.end(), null, true);
});
return;
}
const getPokemonSprite = () => { const getPokemonSprite = () => {
const sprite = this.scene.addPokemonSprite(this.pokemon, this.pokemon.x + this.pokemon.getSprite().x, this.pokemon.y + this.pokemon.getSprite().y, `pkmn__sub`); const sprite = this.scene.addPokemonSprite(this.pokemon, this.pokemon.x + this.pokemon.getSprite().x, this.pokemon.y + this.pokemon.getSprite().y, `pkmn__sub`);
sprite.setOrigin(0.5, 1); sprite.setOrigin(0.5, 1);