Browse Source

Bring back special case for the first victim with nothing found yet - needed so that we avoid stomping nothing at all

tags/v1.1.2
Fen Dweller 5 years ago
parent
commit
34a39643b5
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      recursive-macro.js

+ 4
- 1
recursive-macro.js View File

@@ -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;
}


Loading…
Cancel
Save