From e650271d3a903f890983ecafcfa289526663570e Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 10 Sep 2024 13:41:54 +0100 Subject: [PATCH] Reset repeatable+failed quests to `Fail` instead of `MarkedAsFailed` after raid --- project/src/services/LocationLifecycleService.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/project/src/services/LocationLifecycleService.ts b/project/src/services/LocationLifecycleService.ts index 548f03fa..f69ba823 100644 --- a/project/src/services/LocationLifecycleService.ts +++ b/project/src/services/LocationLifecycleService.ts @@ -528,6 +528,19 @@ export class LocationLifecycleService { } } + // Find marked as failed quests + flagged as restartable and re-status them as 'failed' so they can be restarted by player + const failedQuests = questsToProcess.filter((quest) => quest.status === QuestStatus.MarkedAsFailed); + for (const failedQuest of failedQuests) { + const dbQuest = this.databaseService.getQuests()[failedQuest.qid]; + if (!dbQuest) { + continue; + } + + if (dbQuest.restartable) { + failedQuest.status = QuestStatus.Fail; + } + } + return questsToProcess; }