Skip to content

Commit

Permalink
Fix insert root bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
calvertdw committed Dec 28, 2024
1 parent 7cebed5 commit 25b088c
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,18 @@ public boolean performAllQueuedOperations()

public void queueInsertNode(BehaviorTreeNodeInsertionDefinition<HLT> insertionDefinition)
{
queueAddAndModifyNode(insertionDefinition.getNodeToInsert(),
insertionDefinition.getParent(),
insertionDefinition.getInsertionIndex());
if (insertionDefinition.getInsertionType() == BehaviorTreeNodeInsertionType.INSERT_ROOT)
{
queueSetAndModifyRootNode(insertionDefinition.getNodeToInsert(),
insertionDefinition.getRootNodeSetter(),
insertionDefinition.getRootNodeModifiable());
}
else
{
queueAddAndModifyNode(insertionDefinition.getNodeToInsert(),
insertionDefinition.getParent(),
insertionDefinition.getInsertionIndex());
}
}

public void queueSetAndModifyRootNode(HLT node, Consumer<HLT> setter, LatestTimestampModifiable freezableRootHolder)
Expand Down

0 comments on commit 25b088c

Please sign in to comment.