From f24dbd9fa7169b30c4edffd53311d78145dd099b Mon Sep 17 00:00:00 2001 From: Alex Saveau Date: Sat, 17 Feb 2018 15:34:40 -0800 Subject: [PATCH] Fix first parallel commands in group not being added Signed-off-by: Alex Saveau --- core/src/main/kotlin/org/sertain/command/Command.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/kotlin/org/sertain/command/Command.kt b/core/src/main/kotlin/org/sertain/command/Command.kt index 7a33fe7..e15a9fa 100644 --- a/core/src/main/kotlin/org/sertain/command/Command.kt +++ b/core/src/main/kotlin/org/sertain/command/Command.kt @@ -137,7 +137,8 @@ public class CommandGroup : CommandBridgeMirror() { if (entry.sequential && entries.getOrNull(prevIndex)?.parallel == true) { // Walk back up the stack to find all linear parallel commands for ((trace, prev) in entries.slice(0..prevIndex).reversed().withIndex()) { - if (prev.parallel) continue // Wait until we reach the first sequential entry + // Wait until we reach the first sequential entry + if (prev.parallel && trace != prevIndex) continue val start = prevIndex - trace val parallels = entries.slice(start..prevIndex)