fix: allow manageQuests' deleteKey op to be used with any ItemType
All checks were successful
Build / build (push) Successful in 1m26s
Build / build (pull_request) Successful in 43s

This commit is contained in:
Sainan 2025-04-15 19:43:39 +02:00
parent 28d7ca8ca0
commit 54a345edae

View File

@ -56,15 +56,12 @@ export const manageQuestsController: RequestHandler = async (req, res) => {
break; break;
} }
case "deleteKey": { case "deleteKey": {
if (allQuestKeys.includes(questItemType)) {
const questKey = inventory.QuestKeys.find(key => key.ItemType === questItemType); const questKey = inventory.QuestKeys.find(key => key.ItemType === questItemType);
if (!questKey) { if (!questKey) {
logger.error(`Quest key not found in inventory: ${questItemType}`); logger.error(`Quest key not found in inventory: ${questItemType}`);
break; break;
} }
inventory.QuestKeys.pull({ ItemType: questItemType }); inventory.QuestKeys.pull({ ItemType: questItemType });
}
break; break;
} }
case "completeKey": { case "completeKey": {