-
-
Notifications
You must be signed in to change notification settings - Fork 123
Fix Composites and Sub-Trees not ending their Children when exited #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| using System; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using CleverCrow.Fluid.BTs.Decorators; | ||
| using CleverCrow.Fluid.BTs.TaskParents; | ||
|
|
@@ -179,7 +179,9 @@ public BehaviorTreeBuilder AddNode (ITask node) { | |
| } | ||
|
|
||
| public BehaviorTreeBuilder Splice (BehaviorTree tree) { | ||
| _tree.Splice(PointerCurrent, tree); | ||
| if (tree != null && tree.Root != null) { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmm, I feel like this should technically fail if you're passing in an empty |
||
| _tree.Splice(PointerCurrent, tree); | ||
| } | ||
|
|
||
| return this; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| namespace CleverCrow.Fluid.BTs.TaskParents.Composites { | ||
| namespace CleverCrow.Fluid.BTs.TaskParents.Composites { | ||
| public abstract class CompositeBase : TaskParentBase { | ||
| public int ChildIndex { get; protected set; } | ||
|
|
||
|
|
@@ -13,5 +13,9 @@ public override void Reset () { | |
|
|
||
| base.Reset(); | ||
| } | ||
|
|
||
| protected void NotifyChildEnd(int childEnding) { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the last child not getting an End call on it when the BT tree completes? If so I'll need to get a test in to verify this and that it fixes the created bug. And also do manual regression testing. It looks like there is code in here to call End on tasks automatically instead of manually calling like this. So I'm wondering why this would be needed? Curious what the logic here is to forcibly call end on all the composites. If it's just not being triggered at all that would make sense. But I'm pretty sure End is firing fine in my code base last I checked. Please share more on your specific use case. |
||
| Children[childEnding].End(); | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah nice. Yeah I can see this was creating a graphical display bug