fix: allow manageQuests' deleteKey op to be used with any ItemType (#1653)

Reviewed-on: OpenWF/SpaceNinjaServer#1653
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
Sainan 2025-04-16 06:29:09 -07:00 committed by Sainan
parent 38502f10bf
commit 729061951f

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": {