Don't transfer baton item if target is already holding one

pull/95/head
Flashfyre 2024-04-11 20:58:24 -04:00
parent 747a039a2e
commit a793aedd29
1 changed files with 1 additions and 1 deletions

View File

@ -1294,7 +1294,7 @@ export class SwitchSummonPhase extends SummonPhase {
if (!this.scene.findModifier(m => m instanceof SwitchEffectTransferModifier && (m as SwitchEffectTransferModifier).pokemonId === switchedPokemon.id)) { if (!this.scene.findModifier(m => m instanceof SwitchEffectTransferModifier && (m as SwitchEffectTransferModifier).pokemonId === switchedPokemon.id)) {
const batonPassModifier = this.scene.findModifier(m => m instanceof SwitchEffectTransferModifier const batonPassModifier = this.scene.findModifier(m => m instanceof SwitchEffectTransferModifier
&& (m as SwitchEffectTransferModifier).pokemonId === this.lastPokemon.id) as SwitchEffectTransferModifier; && (m as SwitchEffectTransferModifier).pokemonId === this.lastPokemon.id) as SwitchEffectTransferModifier;
if (batonPassModifier) if (batonPassModifier && !this.scene.findModifier(m => m instanceof SwitchEffectTransferModifier && (m as SwitchEffectTransferModifier).pokemonId === switchedPokemon.id))
this.scene.tryTransferHeldItemModifier(batonPassModifier, switchedPokemon, false, false); this.scene.tryTransferHeldItemModifier(batonPassModifier, switchedPokemon, false, false);
} }
} }