Skip to content

Commit

Permalink
Ensure the member function switch_in sets the Pokemon to a valid st…
Browse files Browse the repository at this point in the history
…ate before it passes itself to a free function.
  • Loading branch information
davidstone committed May 13, 2024
1 parent eeb6f46 commit 0a2078a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/tm/pokemon/active_pokemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,12 +813,12 @@ struct AnyMutableActivePokemon : ActivePokemonImpl<PokemonType> {
this->m_pokemon.set_status(StatusName::poison);
}
this->m_flags.status.set(this->m_pokemon.status().name());
if (this->item(environment) == Item::Berserk_Gene) {
activate_berserk_gene(*this, environment);
}
if (!replacing_fainted_or_initial_switch) {
this->m_flags.last_used_move.use_switch();
}
if (this->item(environment) == Item::Berserk_Gene) {
activate_berserk_gene(*this, environment);
}
}

constexpr auto switch_out() const -> void {
Expand Down

0 comments on commit 0a2078a

Please sign in to comment.