whoops, should still apply to fainted party member

This commit is contained in:
frutescens 2024-11-03 21:38:38 -08:00
parent 8e6688daef
commit 8b189d3747
2 changed files with 3 additions and 3 deletions

View File

@ -5127,8 +5127,8 @@ export class EnemyPokemon extends Pokemon {
newPokemon.setVisible(false); // Hide if replaced with first pokemon
}
if (pokemonReplaced && newPokemon.isAllowedInBattle()) {
const modifiersToTransfer = this.scene.findModifiers(m => m instanceof PokemonHeldItemModifier && m.pokemonId === pokemonReplaced, true) as PokemonHeldItemModifier[];
if (pokemonReplaced && newPokemon.isAllowedInChallenge()) {
const modifiersToTransfer = this.scene.findModifiers(m => m instanceof PokemonHeldItemModifier && !(m instanceof BaseStatModifier) && m.pokemonId === pokemonReplaced, true) as PokemonHeldItemModifier[];
const transferResults: Promise<boolean>[] = [];
for (const modifier of modifiersToTransfer) {
transferResults.push(this.scene.tryTransferHeldItemModifier(modifier, newPokemon, false, modifier.getStackCount(), true, true));

View File

@ -1063,7 +1063,7 @@ export default class PartyUiHandler extends MessageUiHandler {
this.clearPartySlots();
const releasedPokemon = this.scene.getPlayerParty().splice(slotIndex, 1)[0];
let releasedId: number = 0;
if (releasedPokemon.isAllowedInBattle()) {
if (releasedPokemon.isAllowedInChallenge()) {
releasedId = releasedPokemon.id;
}
this.populatePartySlots();