diff --git a/core/src/mindustry/input/Placement.java b/core/src/mindustry/input/Placement.java index 2bac4db62b..351cf7320e 100644 --- a/core/src/mindustry/input/Placement.java +++ b/core/src/mindustry/input/Placement.java @@ -183,9 +183,11 @@ public class Placement{ return; } + Boolf 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 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++){