Open ijisthee opened 8 months ago
@acdamiani Is this possible to fix or is the current way to do it by design and should not be done differently?
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;
}
Above https://github.com/acdamiani/schema/blob/3bc87e426f27b3d9b0ddf1a2db0cca4a578bd9a3/Runtime/Proc/ExecutableNode.cs#L320
should be called.
If this does not happen, cleanup or update tasks cannot run if after a conditional evaluation the node is aborted.