ashblue/fluid-behavior-tree

Decorated TaskBase does not invoke RemoveActiveTask.

Closed this issue · 2 comments

First, Thank you for useful repo.
I have issue.
Decorated TaskBase does not invoke RemoveActiveTask in decorator.

  .Decorator(child=>{
              if(!context.CurrentIsDelay() || !context.CanActionTarget()){
                  child.ParentTree.RemoveActiveTask(child); // should do this for correct working
                  child.End();
                  return TaskStatus.Success;
              }
              
              return child.Update();
          })
              .AddNode(new CombatIdleAction(context.Animator))
          .End_Decorator()

Is this intentional?
How about that call RemoveActiveTask(child) in End() method ?

If i will get permit, i can make PR.
like this
TaskBase.cs

       private void Exit () {
            if (_exit) {
                OnExit();
            }
            if (_active) ParentTree?.RemoveActiveTask(this);
            Reset();
        }

Hadn't seen any issues with decorators. Is this a custom decorator you've created?

Can you explain the expected result that should happen and what's happening instead? Is the behavior tree crashing entirely? Some weird error? Ect.

bt is not crashed. It is minor inconvenience(should call RemoveActiveTask in decorator). I think it is intentional. nvm. Thanks for anwser!!