diff --git a/Assets/Fungus/Scripts/Commands/StopFlowchart.cs b/Assets/Fungus/Scripts/Commands/StopFlowchart.cs index c11cedbb..d439796f 100644 --- a/Assets/Fungus/Scripts/Commands/StopFlowchart.cs +++ b/Assets/Fungus/Scripts/Commands/StopFlowchart.cs @@ -27,21 +27,21 @@ namespace Fungus { var flowchart = GetFlowchart(); - if (stopParentFlowchart) - { - flowchart.StopAllBlocks(); - } - for (int i = 0; i < targetFlowcharts.Count; i++) { var f = targetFlowcharts[i]; - if (f == flowchart) - { - // Flowchart has already been stopped - continue; - } f.StopAllBlocks(); } + + //current block and command logic doesn't require it in this order but it makes sense to + // stop everything but yourself first + if (stopParentFlowchart) + { + flowchart.StopAllBlocks(); + } + + //you might not be stopping this flowchart so keep going + Continue(); } public override bool IsReorderableArray(string propertyName)