This commit is contained in:
Anuken
2023-01-07 13:42:43 -05:00
parent c37ad9210a
commit a15b887e5c

View File

@@ -183,9 +183,11 @@ public class Placement{
return;
}
Boolf<BuildPlan> rotated = plan -> plan.build() != null && same.get(plan.build().block) && plan.rotation != plan.build().rotation;
//TODO for chains of ducts, do not count consecutives in a different rotation as 'placeable'
Boolf<BuildPlan> placeable = plan ->
!(!hasJunction && plan.build() != null && same.get(plan.build().block) && plan.rotation != plan.build().rotation) &&
!(!hasJunction && rotated.get(plan)) &&
(plan.placeable(player.team()) ||
(plan.tile() != null && same.get(plan.tile().block()))); //don't count the same block as inaccessible
@@ -197,7 +199,7 @@ public class Placement{
result.add(cur);
//gap found
if(i < plans.size - 1 && placeable.get(cur) && !placeable.get(plans.get(i + 1))){
if(i < plans.size - 1 && placeable.get(cur) && (!placeable.get(plans.get(i + 1)) || (hasJunction && rotated.get(plans.get(i + 1)) && i < plans.size - 2 && !placeable.get(plans.get(i + 2))))){
//find the closest valid position within range
for(int j = i + 2; j < plans.size; j++){