fix: allow manageQuests' deleteKey op to be used with any ItemType
This commit is contained in:
parent
28d7ca8ca0
commit
54a345edae
@ -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": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user