This commit is contained in:
33333-33333 2026-06-25 14:51:58 +09:00
commit 434f07cc4e
103 changed files with 8387 additions and 8152 deletions

View file

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