not bad
This commit is contained in:
parent
2741b93dea
commit
434f07cc4e
103 changed files with 8387 additions and 8152 deletions
|
|
@ -115,7 +115,8 @@
|
|||
const spot = this.findPlacementSpot ? this.findPlacementSpot(nest, { allowOriginal: true, maxRadius: 80, attempts: 10 }) : { x, y };
|
||||
if (!spot) continue;
|
||||
let nearest = Infinity;
|
||||
for (const it of this.items || []) {
|
||||
const nests = this.itemsOfType ? this.itemsOfType("ant_nest") : (this.items || []);
|
||||
for (const it of nests) {
|
||||
if (!it || it.dead || it.type !== "ant_nest") continue;
|
||||
nearest = Math.min(nearest, distXY(spot.x, spot.y, it.x, it.y));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue