From d6fb1abb3b67a051fc42fc048a78438449c588f7 Mon Sep 17 00:00:00 2001 From: Mael Date: Mon, 21 Jan 2019 16:13:18 +0100 Subject: [PATCH] :bug: :gear: Correction des variabls manquantes de la variation --- source/engine/mecanisms.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/engine/mecanisms.js b/source/engine/mecanisms.js index 4ccb93e7b..3dc6249a7 100644 --- a/source/engine/mecanisms.js +++ b/source/engine/mecanisms.js @@ -151,7 +151,8 @@ export let mecanismVariations = (recurse, k, v, devariate) => { if (evaluatedCondition.nodeValue === null) // one case has missing variables => we can't go further - return [true, [...result, variation]] + return [true, [...result, { condition: evaluatedCondition }]] + if (evaluatedCondition.nodeValue === true) { let evaluatedVariation = { condition: evaluatedCondition, @@ -176,7 +177,9 @@ export let mecanismVariations = (recurse, k, v, devariate) => { node => !node.condition || node.condition.nodeValue !== false, resolvedExplanation ), - rightMissing = mergeAllMissing(pluck('consequence', candidateVariations)), + rightMissing = mergeAllMissing( + reject(isNil, pluck('consequence', candidateVariations)) + ), missingVariables = satisfiedVariation ? collectNodeMissing(satisfiedVariation.consequence) : mergeMissing(bonus(leftMissing), rightMissing)