From f451920fb7b8bb2d7c2b7e91d75c58967171cd30 Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 21 Dec 2023 10:15:57 +0000 Subject: [PATCH] Show error when item not found in player inventory when handing over items for quest --- project/src/controllers/QuestController.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/src/controllers/QuestController.ts b/project/src/controllers/QuestController.ts index c6b0318a..b834b279 100644 --- a/project/src/controllers/QuestController.ts +++ b/project/src/controllers/QuestController.ts @@ -797,8 +797,8 @@ export class QuestController let totalItemCountToRemove = 0; for (const itemHandover of handoverQuestRequest.items) { - const matchingItemInProfile = pmcData.Inventory.items.find((x) => x._id === itemHandover.id); - if (!handoverRequirements._props.target.includes(matchingItemInProfile._tpl)) + const matchingItemInProfile = pmcData.Inventory.items.find((item) => item._id === itemHandover.id); + if (!matchingItemInProfile || !handoverRequirements._props.target.includes(matchingItemInProfile._tpl)) { // Item handed in by player doesnt match what was requested return this.showQuestItemHandoverMatchError(