Fix: return the found quest

This commit is contained in:
Dev 2023-03-21 14:22:45 +00:00
parent 1fc35881d8
commit 249730ee65

View File

@ -297,11 +297,12 @@ export class QuestController
{ {
for (const repeatableQuest of pmcData.RepeatableQuests) for (const repeatableQuest of pmcData.RepeatableQuests)
{ {
const result = repeatableQuest.activeQuests.find(x => x._id === acceptedQuest.qid); const matchingQuest = repeatableQuest.activeQuests.find(x => x._id === acceptedQuest.qid);
if (result) if (matchingQuest)
{ {
this.logger.debug(`Accepted repeatable quest ${acceptedQuest.qid} from ${repeatableQuest.name}`); this.logger.debug(`Accepted repeatable quest ${acceptedQuest.qid} from ${repeatableQuest.name}`);
break;
return matchingQuest;
} }
} }