Skip to content

Commit

Permalink
fix: Use Fallback Node if targeted node not found. (#527)
Browse files Browse the repository at this point in the history
* Hotfix: Use Fallback Node if targeted node not found.

* Change error log to warning.
  • Loading branch information
MrPurple6411 committed Jan 7, 2024
1 parent 42e3ca7 commit 48d9b00
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Nautilus/Patchers/CraftTreePatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,13 @@ private static void PatchNodes(ref CraftTree tree, CraftTree.Type type)
{
if (!TraverseTree(tree.nodes, customNode.Path, out var currentNode))
{
InternalLogger.Error($"Cannot add Crafting node: {customNode.TechType.AsString()} to {customNode.Scheme} at {string.Join("/", customNode.Path)} as the parent node could not be found.");
continue;
InternalLogger.Warn($"Cannot add Crafting node: {customNode.TechType.AsString()} to {customNode.Scheme} at {string.Join("/", customNode.Path)} as the parent node could not be found.");

if (!TraverseTree(tree.nodes, new[] { FallbackTabNode + customNode.Scheme }, out currentNode))
{
InternalLogger.Error($"Cannot add Crafting node: {customNode.TechType.AsString()} to {customNode.Scheme} at {string.Join("/", customNode.Path)} as the fallback node could not be found.");
continue;
}
}

if (currentNode.nodes.Any(x => x is CraftNode craftNode && craftNode.action == TreeAction.Expand))
Expand Down

0 comments on commit 48d9b00

Please sign in to comment.