From 7a3ca3a302c4c242409d5fd8e013d42325af0e4f Mon Sep 17 00:00:00 2001 From: Buddy Sandidge Date: Mon, 4 Nov 2019 15:25:13 -0800 Subject: [PATCH] Fix issue with not returning best result --- buckets.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/buckets.js b/buckets.js index 1d2073a..6800db1 100644 --- a/buckets.js +++ b/buckets.js @@ -62,10 +62,10 @@ class Buckets { best = result; return } - if (best.length == result.length) { + if (best[0].length == result[0].length) { best.push(result); } - if (best.length > result.length) { + if (best[0].length > result[0].length) { best = result; } }) @@ -92,6 +92,7 @@ class Buckets { const action = possibleActions[i]; if (result.hasTarget(target)) { + debugger state.matching.add(result.string()); }