Skip to content

Commit 4fec989

Browse files
committed
Apply changes in ReactiveSequence to ReactiveFallback too
1 parent 6117937 commit 4fec989

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/controls/reactive_fallback.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ NodeStatus ReactiveFallback::tick()
3232
switch (child_status)
3333
{
3434
case NodeStatus::RUNNING: {
35-
for (size_t i = index + 1; i < childrenCount(); i++)
35+
// reset the previous children, to make sure that they are in IDLE state
36+
// the next time we tick them
37+
for (size_t i = 0; i < index; i++)
3638
{
3739
haltChild(i);
3840
}
@@ -61,11 +63,7 @@ NodeStatus ReactiveFallback::tick()
6163
} // end switch
6264
} //end for
6365

64-
if (failure_count == childrenCount())
65-
{
66-
resetChildren();
67-
return NodeStatus::FAILURE;
68-
}
66+
resetChildren();
6967

7068
// Skip if ALL the nodes have been skipped
7169
return all_skipped ? NodeStatus::SKIPPED : NodeStatus::FAILURE;

0 commit comments

Comments
 (0)