diff --git a/QuestMap/Node.cs b/QuestMap/Node.cs index a73f705..439cce2 100644 --- a/QuestMap/Node.cs +++ b/QuestMap/Node.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Dalamud.Plugin.Services; using Lumina.Excel.GeneratedSheets; namespace QuestMap { @@ -101,7 +102,8 @@ namespace QuestMap { } } - internal static (List>, Dictionary>) BuildTree(Dictionary layouts) { + internal static (List>, Dictionary>) BuildTree(Dictionary layouts, + IDataManager dataManager) { var lookup = new Dictionary>(); var rootNodes = new List>(); var allNodes = new Dictionary>(); @@ -115,7 +117,7 @@ namespace QuestMap { allNodes[item.Key] = ourNode; } - var previous = item.Value.PreviousQuests().ToList(); + var previous = item.Value.PreviousQuests(dataManager).ToList(); if (previous.Count == 0) { rootNodes.Add(ourNode); } else { @@ -150,12 +152,19 @@ namespace QuestMap { return null; } - internal static IEnumerable PreviousQuests(this Quest quest) { + internal static IEnumerable PreviousQuests(this Quest quest, IDataManager dataManager) { foreach (var previous in quest.PreviousQuest) { if (previous != null && previous.Row != 0) { yield return previous.Value!; } } + + if (quest.Unknown12 != 0) + { + var previous = dataManager.GetExcelSheet()!.GetRow(quest.Unknown12); + if (previous != null) + yield return previous; + } } } } diff --git a/QuestMap/Quests.cs b/QuestMap/Quests.cs index 9925bf3..0a3b264 100644 --- a/QuestMap/Quests.cs +++ b/QuestMap/Quests.cs @@ -112,7 +112,7 @@ namespace QuestMap { this.BeastRewards = beastRewards; this.JobRewards = jobRewards; - var (_, nodes) = Node.BuildTree(allQuests); + var (_, nodes) = Node.BuildTree(allQuests, this.Plugin.DataManager); this.AllNodes = nodes; }