Fix pickup working on the same item multiple times

pull/16/head
Flashfyre 2024-03-08 14:49:17 -05:00
parent b147cf8f37
commit 4d8663d274
1 changed files with 1 additions and 0 deletions

View File

@ -1036,6 +1036,7 @@ export class PostBattleLootAbAttr extends PostBattleAbAttr {
if (postBattleLoot.length) {
const randItem = Utils.randSeedItem(postBattleLoot);
if (pokemon.scene.tryTransferHeldItemModifier(randItem, pokemon, false, true, true)) {
postBattleLoot.splice(postBattleLoot.indexOf(randItem), 1);
pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` picked up\n${randItem.type.name}!`));
return true;
}