Fix index of the item to swap not being updated

This commit is contained in:
Eucalyptus 2024-08-22 12:48:54 -04:00
parent 9a9a0274d9
commit 9d63f24b28
1 changed files with 2 additions and 2 deletions

View File

@ -6102,7 +6102,7 @@ export class SwapHeldItemsAttr extends MoveEffectAttr {
}));
if (targetHeldItems.length) {
const swapItemIdx = 0;
let swapItemIdx = 0;
const targetPool = target.isPlayer() ? ModifierPoolType.PLAYER : ModifierPoolType.TRAINER;
for (let idx = 1; idx < targetHeldItems.length; idx++) {
@ -6114,7 +6114,7 @@ export class SwapHeldItemsAttr extends MoveEffectAttr {
currentItemTier = currentItemTier !== null ? currentItemTier : ModifierTier.COMMON;
if (nextItemNotFlameOrToxic && (nextItemTier > currentItemTier || currentItemFlameOrToxic)) {
targetHeldItems[swapItemIdx] = targetHeldItems[idx];
swapItemIdx = idx;
}
if (targetHeldItems[swapItemIdx].type.tier === ModifierTier.LUXURY) {