Skip to content
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

Missing OnNodeExit() Call on conditional node abort #23

Open
ijisthee opened this issue Feb 4, 2024 · 3 comments · May be fixed by #25
Open

Missing OnNodeExit() Call on conditional node abort #23

ijisthee opened this issue Feb 4, 2024 · 3 comments · May be fixed by #25

Comments

@ijisthee
Copy link

ijisthee commented Feb 4, 2024

Above

return parent;

action.OnNodeExit(nodeMemory[id], context.agent);

should be called.

If this does not happen, cleanup or update tasks cannot run if after a conditional evaluation the node is aborted.

@ijisthee
Copy link
Author

@acdamiani Is this possible to fix or is the current way to do it by design and should not be done differently?

@ijisthee
Copy link
Author

Here a proposal that works for me. Maybe you could find a better implementation:

if (context.last.index != index || forceConditionalEvaluation)
    run = DoConditionalStack(id, context);

if (!run)
{
    context.status = NodeStatus.Failure;
    if (context.node.node is Action actionToAbort)
    {
        actionToAbort.OnNodeExit(nodeMemory[id], context.agent);
    }

    return parent;
}

@acdamiani acdamiani linked a pull request Feb 28, 2024 that will close this issue
@ijisthee
Copy link
Author

reviewed #25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant