From 4fd37e3a92bc91c81000566798c71542c571b46a Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 19 Jan 2024 22:49:31 +0000 Subject: [PATCH] Fix all items being free --- project/src/helpers/ItemHelper.ts | 2 +- project/src/services/PaymentService.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/project/src/helpers/ItemHelper.ts b/project/src/helpers/ItemHelper.ts index 3a224a3a..84ad9454 100644 --- a/project/src/helpers/ItemHelper.ts +++ b/project/src/helpers/ItemHelper.ts @@ -636,7 +636,7 @@ export class ItemHelper : (item._id === barterId); }); - matchingItems.push(...this.jsonUtil.clone(filterResult)); + matchingItems.push(...filterResult); } if (matchingItems.length === 0) diff --git a/project/src/services/PaymentService.ts b/project/src/services/PaymentService.ts index beb02c1e..c5d6334b 100644 --- a/project/src/services/PaymentService.ts +++ b/project/src/services/PaymentService.ts @@ -306,19 +306,19 @@ export class PaymentService } let leftToPay = amountToPay; - for (const moneyItem of moneyItemsInInventory) + for (const profileMoneyItem of moneyItemsInInventory) { - const itemAmount = moneyItem.upd.StackObjectsCount; + const itemAmount = profileMoneyItem.upd.StackObjectsCount; if (leftToPay >= itemAmount) { leftToPay -= itemAmount; - this.inventoryHelper.removeItem(pmcData, moneyItem._id, sessionID, output); + this.inventoryHelper.removeItem(pmcData, profileMoneyItem._id, sessionID, output); } else { - moneyItem.upd.StackObjectsCount -= leftToPay; + profileMoneyItem.upd.StackObjectsCount -= leftToPay; leftToPay = 0; - output.profileChanges[sessionID].items.change.push(moneyItem); + output.profileChanges[sessionID].items.change.push(profileMoneyItem); } if (leftToPay === 0)