From f9f2a67bbf155be6ecbd3aaf2adde0f008f58f6a Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Thu, 3 Nov 2022 17:01:26 +0100 Subject: [PATCH] Fix BTParallel getting stuck when repeat=false and criterea are not met --- bt/composites/bt_parallel.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bt/composites/bt_parallel.cpp b/bt/composites/bt_parallel.cpp index 517c84c..7a991a6 100644 --- a/bt/composites/bt_parallel.cpp +++ b/bt/composites/bt_parallel.cpp @@ -33,6 +33,9 @@ int BTParallel::_tick(float p_delta) { } } } + if (!repeat && (num_failed + num_succeeded) == get_child_count() && return_status == RUNNING) { + return_status = FAILURE; + } return return_status; }