From a15b887e5c8d3210158a07764b653c8a97520c82 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 7 Jan 2023 13:42:43 -0500 Subject: [PATCH] Fixed #8011 --- core/src/mindustry/input/Placement.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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++){