hm
This commit is contained in:
parent
7455d630fc
commit
4d3fc2cd47
84 changed files with 3429 additions and 3480 deletions
|
|
@ -108,7 +108,7 @@ function grassMaterialAvailableStages(material) {
|
|||
return Math.max(0, Math.floor(Number(stage) || 0) + 1);
|
||||
}
|
||||
|
||||
function reservedGrassStagesForBuildMaterial(world, material, type, self = null) {
|
||||
function reservedBuildGrassStages(world, material, type, self = null) {
|
||||
if (!world || !material) return 0;
|
||||
const id = material.id || "";
|
||||
if (!id) return 0;
|
||||
|
|
@ -140,7 +140,7 @@ function findNearbyBuildMaterial(world, tarinai, type, maxDist = 520) {
|
|||
if (world?.targetBlockedByObstacle?.(tarinai, item, Math.max(18, (tarinai.radius || 20) * 0.65))) continue;
|
||||
const available = grassMaterialAvailableStages(item);
|
||||
if (available < required) continue;
|
||||
const reserved = reservedGrassStagesForBuildMaterial(world, item, type, tarinai);
|
||||
const reserved = reservedBuildGrassStages(world, item, type, tarinai);
|
||||
if (available - reserved < required) continue;
|
||||
const d = dist(tarinai, item);
|
||||
if (d > maxDist) continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue