返回提交历史
Modified
src/controllers/custom/manageQuestsController.ts
+5
-8
XFEstudio/SpaceNinjaServer
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>
72906195
代码差异
1 个文件
+5
-8
@@ -56,15 +56,12 @@ export const manageQuestsController: RequestHandler = async (req, res) => {
56
56
break;
57
57
}
58
58
case "deleteKey": {
59
if (allQuestKeys.includes(questItemType)) {
60
const questKey = inventory.QuestKeys.find(key => key.ItemType === questItemType);
61
if (!questKey) {
62
logger.error(`Quest key not found in inventory: ${questItemType}`);
63
break;
64
}
65
66
inventory.QuestKeys.pull({ ItemType: questItemType });
59
const questKey = inventory.QuestKeys.find(key => key.ItemType === questItemType);
60
if (!questKey) {
61
logger.error(`Quest key not found in inventory: ${questItemType}`);
62
break;
67
63
}
64
inventory.QuestKeys.pull({ ItemType: questItemType });
68
65
break;
69
66
}
70
67
case "completeKey": {