mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-30 02:36:11 +00:00
Fix form change edge case causing crash
This commit is contained in:
parent
c848755426
commit
d4eae67768
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user