From 249730ee657077760038de93d182339469dc243f Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 21 Mar 2023 14:22:45 +0000 Subject: [PATCH] Fix: return the found quest --- project/src/controllers/QuestController.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/project/src/controllers/QuestController.ts b/project/src/controllers/QuestController.ts index 804b423a..92750066 100644 --- a/project/src/controllers/QuestController.ts +++ b/project/src/controllers/QuestController.ts @@ -297,11 +297,12 @@ export class QuestController { for (const repeatableQuest of pmcData.RepeatableQuests) { - const result = repeatableQuest.activeQuests.find(x => x._id === acceptedQuest.qid); - if (result) + const matchingQuest = repeatableQuest.activeQuests.find(x => x._id === acceptedQuest.qid); + if (matchingQuest) { this.logger.debug(`Accepted repeatable quest ${acceptedQuest.qid} from ${repeatableQuest.name}`); - break; + + return matchingQuest; } }