From 729061951fb1e54632e0c457b32db412f7596b86 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Wed, 16 Apr 2025 06:29:09 -0700 Subject: [PATCH] fix: allow manageQuests' deleteKey op to be used with any ItemType (#1653) Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1653 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- 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": {