Fix issues with held item transfer
parent
8ae78fcd05
commit
1fd5f6c01f
|
@ -1082,7 +1082,7 @@ export default class BattleScene extends Phaser.Scene {
|
|||
const newItemModifier = itemModifier.clone() as PokemonHeldItemModifier;
|
||||
newItemModifier.pokemonId = target.id;
|
||||
const matchingModifier = target.scene.findModifier(m => m instanceof PokemonHeldItemModifier
|
||||
&& (m as PokemonHeldItemModifier).matchType(itemModifier), target.isPlayer()) as PokemonHeldItemModifier;
|
||||
&& (m as PokemonHeldItemModifier).matchType(itemModifier) && m.pokemonId === target.id, target.isPlayer()) as PokemonHeldItemModifier;
|
||||
let removeOld = true;
|
||||
if (matchingModifier) {
|
||||
const maxStackCount = matchingModifier.getMaxStackCount();
|
||||
|
|
|
@ -153,8 +153,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
|||
|
||||
this.fieldIndex = args.length > 1 ? args[1] as integer : -1;
|
||||
|
||||
if (args.length > 2 && args[2] instanceof Function)
|
||||
this.selectCallback = args[2];
|
||||
this.selectCallback = args.length > 2 && args[2] instanceof Function ? args[2] : undefined;
|
||||
this.selectFilter = args.length > 3 && args[3] instanceof Function
|
||||
? args[3] as PokemonSelectFilter
|
||||
: PartyUiHandler.FilterAll;
|
||||
|
|
Loading…
Reference in New Issue