Skip to content

Commit

Permalink
Fix tooltips getting cleared when using switch moves
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik99999 committed May 21, 2024
1 parent bc98615 commit 07ad30a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion play.pokemonshowdown.com/src/battle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,7 @@ export class Side {
const effect = Dex.getEffect(kwArgs.from);
if (['batonpass', 'zbatonpass', 'shedtail'].includes(effect.id)) {
pokemon.copyVolatileFrom(this.lastPokemon!, effect.id === 'shedtail' ? 'shedtail' : false);
this.lastPokemon = null;
}

this.battle.scene.animSummon(pokemon, slot);
Expand Down Expand Up @@ -901,7 +902,11 @@ export class Side {
}
pokemon.statusData.toxicTurns = 0;
if (this.battle.gen === 5) pokemon.statusData.sleepTurns = 0;
this.lastPokemon = pokemon;
if (effect.id && !['batonpass', 'zbatonpass', 'shedtail'].includes(effect.id)) {
this.lastPokemon = null;
} else {
this.lastPokemon = pokemon;
}
this.active[slot] = null;

this.battle.scene.animUnsummon(pokemon);
Expand Down

0 comments on commit 07ad30a

Please sign in to comment.