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;
|
const newItemModifier = itemModifier.clone() as PokemonHeldItemModifier;
|
||||||
newItemModifier.pokemonId = target.id;
|
newItemModifier.pokemonId = target.id;
|
||||||
const matchingModifier = target.scene.findModifier(m => m instanceof PokemonHeldItemModifier
|
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;
|
let removeOld = true;
|
||||||
if (matchingModifier) {
|
if (matchingModifier) {
|
||||||
const maxStackCount = matchingModifier.getMaxStackCount();
|
const maxStackCount = matchingModifier.getMaxStackCount();
|
||||||
|
|
|
@ -153,8 +153,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
||||||
|
|
||||||
this.fieldIndex = args.length > 1 ? args[1] as integer : -1;
|
this.fieldIndex = args.length > 1 ? args[1] as integer : -1;
|
||||||
|
|
||||||
if (args.length > 2 && args[2] instanceof Function)
|
this.selectCallback = args.length > 2 && args[2] instanceof Function ? args[2] : undefined;
|
||||||
this.selectCallback = args[2];
|
|
||||||
this.selectFilter = args.length > 3 && args[3] instanceof Function
|
this.selectFilter = args.length > 3 && args[3] instanceof Function
|
||||||
? args[3] as PokemonSelectFilter
|
? args[3] as PokemonSelectFilter
|
||||||
: PartyUiHandler.FilterAll;
|
: PartyUiHandler.FilterAll;
|
||||||
|
|
Loading…
Reference in New Issue