Re: ORK integration
Posted: Sun Nov 24, 2024 12:25 am
Made a change on the QuestJournal that chatgpr proposed, this is the new method that seems to work, lmk if its enough or you have another solution:
Code: Select all
protected virtual void VerifyTrueNodeChildrenAreActive()
{
// Create a copy of the quest list to iterate over safely
var questListCopy = new List<Quest>(questList);
foreach (var quest in questListCopy)
{
// Only process active quests
if (quest.GetState() != QuestState.Active) continue;
var processed = new HashSet<QuestNode>();
foreach (var node in quest.nodeList)
{
if (processed.Contains(node)) continue;
processed.Add(node);
// Check for True nodes
if (node.GetState() == QuestNodeState.True)
{
foreach (var child in node.childList)
{
// Activate inactive children
if (child.GetState() == QuestNodeState.Inactive)
{
child.SetState(QuestNodeState.Active);
}
}
}
}
}
}