StateTree: completion bit of a state with no completion-considered task is never reset

Summary

FStateTreeTasksCompletionStatus::Push() never resets a state’s extra “state completed” bit, so the state can report Succeeded on entry and its children’s completion transitions are never evaluated.
When none of a state’s tasks is considered for completion, the compiler allocates one extra “state completed” bit right after the task bits (MakeCompletionTasksMask). Push() resets only State.TasksNum bits, so that bit is never cleared. Bit slots are reused between non-concurrent states, and task writes ignore the mask, so a sibling’s finished task can leave it set.

What Type of Bug are you experiencing?

AI

Steps to Reproduce

  1. In a StateTree, add sibling states A and B under the same parent; give A 3+ tasks, and B 2 tasks with “Completion” unchecked on both.
  2. Give B a child state C with a completion transition, e.g. On State Completed → D.
  3. Play until A completes and the tree transitions into B, then let C complete.

Expected Result

B stays Running; C’s completion transition is evaluated and the tree transitions to D.

Observed Result

B reports Succeeded as soon as it is entered (its “state completed” bit was left set by A’s task). The completion-transition search starts at B, C’s transition is never evaluated, and the tree falls back to the root state.

Affects Versions

5.8

Platform(s)

Windows