mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-07 17:02:16 +02:00
adding fainted check to fix the bug
This commit is contained in:
parent
682e33e0e1
commit
08e22e680d
@ -44,9 +44,14 @@ export class FaintPhase extends PokemonPhase {
|
||||
}
|
||||
}
|
||||
|
||||
/** In case the current pokemon was just switched in, make sure it is counted as participating in the combat */
|
||||
/**
|
||||
* In case the current pokemon was just switched in, make sure it is counted as participating in the combat.
|
||||
* For EXP_SHARE purposes, if the current pokemon faints as the combat ends and it was the ONLY player pokemon
|
||||
* involved in combat, it needs to be counted as a participant so the other party pokemon can get their EXP,
|
||||
* so the fainted pokemon has been included.
|
||||
*/
|
||||
this.scene.getField().forEach((pokemon, i) => {
|
||||
if (pokemon?.isActive()) {
|
||||
if (pokemon?.isActive() || pokemon?.isFainted()) {
|
||||
if (pokemon.isPlayer()) {
|
||||
this.scene.currentBattle.addParticipant(pokemon as PlayerPokemon);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user