From 34a39643b50d98ab55c66dc8d2093eb1986acb31 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sun, 22 Dec 2019 09:27:53 -0500 Subject: [PATCH] Bring back special case for the first victim with nothing found yet - needed so that we avoid stomping nothing at all --- recursive-macro.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recursive-macro.js b/recursive-macro.js index c927c09..2075560 100644 --- a/recursive-macro.js +++ b/recursive-macro.js @@ -405,7 +405,10 @@ function fill_area(area, weights, variance=0.15) while (loopvar < limit) { - if (loopvar <= clusters[candidate.name]) { + if (loopvar == 0 && result.length == 0) { + ++count; + } + else if (loopvar <= clusters[candidate.name]) { if (Math.random() < candidate.weight ? 1 : Math.random() < cluster_chances[candidate.name]) { ++count; }