Show error when quest not found in db

This commit is contained in:
Dev 2024-01-14 10:27:26 +00:00
parent 00660747a5
commit 41d491dd16

View File

@ -412,9 +412,14 @@ export class QuestHelper
statusTimers: {},
};
// Check if quest has a prereq to be placed in a 'pending' state
// Check if quest has a prereq to be placed in a 'pending' state, otherwise set status timers value
const questDbData = this.getQuestFromDb(acceptedQuest.qid, pmcData);
const waitTime = questDbData.conditions.AvailableForStart.find((x) => x.availableAfter > 0);
if (!questDbData)
{
this.logger.error(`Quest: ${acceptedQuest.qid} of type: ${acceptedQuest.type} not found`);
}
const waitTime = questDbData?.conditions.AvailableForStart.find((x) => x.availableAfter > 0);
if (waitTime && acceptedQuest.type !== "repeatable")
{
// Quest should be put into 'pending' state