add logging to show when quest prereq was skipped/added
This commit is contained in:
parent
786740c4e1
commit
b29719f6ad
@ -99,10 +99,15 @@ namespace GenerateQuestFile
|
||||
}
|
||||
|
||||
var questRequirement = QuestHelper.GetQuestDependancy(quest.Key);
|
||||
if (questRequirement != null
|
||||
&& !string.IsNullOrEmpty(questRequirement.PreceedingQuest)
|
||||
&& !quest.Value.conditions.AvailableForStart.Any(x => x._parent == "Quest" && x._props.target.ToString() == questRequirement.PreceedingQuest))
|
||||
if (questRequirement == null || questRequirement.PreceedingQuest?.Length == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!quest.Value.conditions.AvailableForStart.Any(x => x._parent == "Quest"
|
||||
&& x._props.target.ToString() == questRequirement.PreceedingQuest))
|
||||
{
|
||||
LoggingHelpers.LogSuccess($"{quest.Value.QuestName} needs a prereq of quest {QuestHelper.GetQuestNameById(questRequirement.PreceedingQuest)}, adding.");
|
||||
quest.Value.conditions.AvailableForStart.Add(new AvailableFor
|
||||
{
|
||||
_parent = "Quest",
|
||||
@ -117,6 +122,13 @@ namespace GenerateQuestFile
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (questRequirement != null)
|
||||
{
|
||||
LoggingHelpers.LogInfo($"{quest.Value.QuestName} already has prereq of quest {QuestHelper.GetQuestNameById(questRequirement.PreceedingQuest)}, skipping.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JsonWriter.WriteJson(questsToOutputToFile, "output", Directory.GetCurrentDirectory(), "quests");
|
||||
|
Loading…
x
Reference in New Issue
Block a user