From d3afe0b6f3fff6a2c00c7c6053c2212a0986be07 Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 6 Jan 2024 09:11:04 +0000 Subject: [PATCH] Fix issue with completing a quest Altered `addTimeLockedQuestsToProfile()` to not fail when checked quest has no `target` property Altered `getNewlyAccessibleQuestsWhenStartingQuest()` to check all statuses of quest, not just first --- project/src/controllers/QuestController.ts | 2 +- project/src/helpers/QuestHelper.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/project/src/controllers/QuestController.ts b/project/src/controllers/QuestController.ts index 04eff58a..5c3c785b 100644 --- a/project/src/controllers/QuestController.ts +++ b/project/src/controllers/QuestController.ts @@ -640,7 +640,7 @@ export class QuestController { // If quest has prereq of completed quest + availableAfter value > 0 (quest has wait time) const nextQuestWaitCondition = quest.conditions.AvailableForStart.find((x) => - x.target.includes(completedQuestId) && x.availableAfter > 0 + x.target?.includes(completedQuestId) && x.availableAfter > 0 ); if (nextQuestWaitCondition) { diff --git a/project/src/helpers/QuestHelper.ts b/project/src/helpers/QuestHelper.ts index 36bae2df..a1ad94dc 100644 --- a/project/src/helpers/QuestHelper.ts +++ b/project/src/helpers/QuestHelper.ts @@ -412,8 +412,8 @@ export class QuestHelper const acceptedQuestCondition = quest.conditions.AvailableForStart.find((x) => { return x.conditionType === "Quest" - && x.target.includes(startedQuestId) - && x.status[0] === QuestStatus.Started; + && x.target?.includes(startedQuestId) + && x.status?.includes(QuestStatus.Started); }); // Not found, skip quest