From 54a345edaec79672f76e5fa1c85e7de7d1579504 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Tue, 15 Apr 2025 19:43:39 +0200 Subject: [PATCH] fix: allow manageQuests' deleteKey op to be used with any ItemType --- src/controllers/custom/manageQuestsController.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/controllers/custom/manageQuestsController.ts b/src/controllers/custom/manageQuestsController.ts index 49ae004c..04650a06 100644 --- a/src/controllers/custom/manageQuestsController.ts +++ b/src/controllers/custom/manageQuestsController.ts @@ -56,15 +56,12 @@ export const manageQuestsController: RequestHandler = async (req, res) => { break; } case "deleteKey": { - if (allQuestKeys.includes(questItemType)) { - const questKey = inventory.QuestKeys.find(key => key.ItemType === questItemType); - if (!questKey) { - logger.error(`Quest key not found in inventory: ${questItemType}`); - break; - } - - inventory.QuestKeys.pull({ ItemType: questItemType }); + const questKey = inventory.QuestKeys.find(key => key.ItemType === questItemType); + if (!questKey) { + logger.error(`Quest key not found in inventory: ${questItemType}`); + break; } + inventory.QuestKeys.pull({ ItemType: questItemType }); break; } case "completeKey": {