From 8a87925c28e71d7ef221cf4593a866bad41399f1 Mon Sep 17 00:00:00 2001 From: Sychotix Date: Wed, 2 Jan 2019 11:06:24 -0500 Subject: [PATCH] Fixed DecoratorContinue never calling the CanRunDecoratorDelegate The CanRunDecoratorDelegate was never run for the DecoratorContinue component. I have added the necessary code to ensure it matches Decorator's execute method, but instead returnings Success. --- TreeSharp/DecoratorContinue.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/TreeSharp/DecoratorContinue.cs b/TreeSharp/DecoratorContinue.cs index 700725b..73fff28 100644 --- a/TreeSharp/DecoratorContinue.cs +++ b/TreeSharp/DecoratorContinue.cs @@ -60,7 +60,15 @@ private RunStatus GetContinuationStatus() public override IEnumerable Execute(object context) { - if (!CanRun(context)) + if (Runner != null) + { + if (!Runner(context)) + { + yield return RunStatus.Success; + yield break; + } + } + else if (!CanRun(context)) { yield return RunStatus.Success; yield break;